Tuesday, 27 October 2026

Parasitic Numbers

My inbox contained the following content from Puzzle A Day:

The number 105263157894736842 is fascinating. This is because it’s the smallest positive integer with a remarkable property that occurs when you move its final digit to the front: 210526315789473684. How is the new number related to the original?

It doesn't take long to see the new number is twice the original. I got Gemini to investigate further via this query:

The number 105263157894736842 is the smallest positive integer with a remarkable property that it doubles when you move its final digit to the front: 210526315789473684. This is quite a large number. Why are there no smaller numbers with this property? What is the next largest number? Is there any history behind the discovery of such numbers? There must be somebody who first discovered it.

Here was Gemini's response:

Numbers that multiply by an integer \(k\) when their trailing digit is shifted to the front are known in recreational number theory as \(k\)-parasitic numbers—and the smallest solutions for each multiplier are specifically called Dyson numbers. The 18-digit integer \(105{,}263{,}157{,}894{,}736{,}842\) is the smallest 2-parasitic number in base 10.

1. Why There Are No Smaller Solutions

To see why 18 digits is the absolute minimum, we can translate the digit-shifting operation into a modular congruence.

Suppose an \(m\)-digit number \(X\) ends with the units digit \(d\) (where \(1 \le d \le 9\)), and the remaining \(m-1\) leading digits form the number \(A\). We can express \(X\) as:\[X = 10A + d\]Moving the final digit \(d\) to the front of the \(m-1\) digits of \(A\) produces the shifted number:\[Y = d \cdot 10^{m-1} + A\]We require this shifted number to be exactly twice the original number (\(Y = 2X\)):\[ \begin{aligned} d \cdot 10^{m-1} + A &= 2(10A + d)  \\ \\ d \cdot 10^{m-1} + A &= 20A + 2d \\ \\ 19A &= d \, (10^{m-1} - 2) \end{aligned} \]Now solve for the original number \(X = 10A + d\) by multiplying both sides by \(19\):\[ \begin{aligned} 19X &= 19(10A + d) = 10(19A) + 19d \\ \\ 19X &= 10d \, (10^{m-1} - 2) + 19d = d \,(10^m - 20 + 19) \\ \\ X &= \frac{d \, (10^m - 1)}{19} \end{aligned} \]For \(X\) to be a positive integer, the numerator \(d \, (10^m - 1)\) must be divisible by \(19\):

  • Since \(d\) is a single digit (\(1 \le d \le 9\)) and \(19\) is prime, \(\gcd(d, 19) = 1\).
  • Therefore, \(19\) must divide \(10^m - 1\), which is equivalent to the congruence:\[10^m \equiv 1 \pmod{19}\]The smallest positive integer \(m\) that satisfies \(10^m \equiv 1 \pmod{19}\) is the multiplicative order of \(10\) modulo \(19\). By Fermat's Little Theorem, \(m\) must be a divisor of \(\phi(19) = 18\) (so \(m \in \{1, 2, 3, 6, 9, 18\}\)). Checking the smaller divisors modulo \(19\):
  • \(10^1 \equiv 10 \pmod{19}\)
  • \(10^2 \equiv 5 \pmod{19}\)
  • \(10^3 \equiv 12 \pmod{19}\)
  • \(10^6 \equiv (12)^2 \equiv 11 \pmod{19}\)
  • \(10^9 \equiv 12 \cdot 11 \equiv 18 \equiv -1 \pmod{19}\)

Because \(10\) is a primitive root modulo \(19\) (and \(19\) is a full reptend prime in base 10), the decimal expansion of \(\frac{1}{19}\) has the maximum possible period length of \(19 - 1 = 18\). No power of \(10\) smaller than \(10^{18}\) leaves a remainder of \(1\) when divided by \(19\), making an 18-digit number the shortest possible length.

Furthermore, we cannot pick \(d = 1\). If \(d = 1\), then$$X = \frac{10^{18} - 1}{19} = 052{,}631{,}578{,}947{,}368{,}421$$which has a leading zero and is actually a 17-digit number whose shift fails unless padded with a leading zero. Thus, \(d = 2\) yields the true smallest positive solution.

2. What Are the Next Largest Numbers?

Every valid choice of units digit \(d \in \{2, 3, 4, 5, 6, 7, 8, 9\}\) in the formula:$$ X = \frac{d \,(10^{18} - 1)}{19}$$ generates an 18-digit solution. Because \(\frac{1}{19}\) is a cyclic number, all eight 18-digit solutions are simply integer multiples of \(\frac{10^{18}-1}{19}\) and are cyclic permutations of the exact same 18 digits:

Rank Units Digit d Fraction 2-Parasitic Number X Doubled / Shifted Result 2X
1 \(d = 2\) \(2/19\) \(105{,}263{,}157{,}894{,}736{,}842\) \(210{,}526{,}315{,}789{,}473{,}684\)
2 \(d = 3\) \(3/19\) \(157{,}894{,}736{,}842{,}105{,}263\) \(315{,}789{,}473{,}684{,}210{,}526\)
3 \(d = 4\) \(4/19\) \(210{,}526{,}315{,}789{,}473{,}684\) \(421{,}052{,}631{,}578{,}947{,}368\)
4 \(d = 5\) \(5/19\) \(263{,}157{,}894{,}736{,}842{,}105\) \(526{,}315{,}789{,}473{,}684{,}210\)
5 \(d = 6\) \(6/19\) \(315{,}789{,}473{,}684{,}210{,}526\) \(631{,}578{,}947{,}368{,}421{,}052\)
6 \(d = 7\) \(7/19\) \(368{,}421{,}052{,}631{,}578{,}947\) \(736{,}842{,}105{,}263{,}157{,}894\)
7 \(d = 8\) \(8/19\) \(421{,}052{,}631{,}578{,}947{,}368\) \(842{,}105{,}263{,}157{,}894{,}736\)
8 \(d = 9\) \(9/19\) \(473{,}684{,}210{,}526{,}315{,}789\) \(947{,}368{,}421{,}052{,}631{,}578\)
  • The immediate next largest number is the \(d = 3\) case: \(157{,}894{,}736{,}842{,}105{,}263\).
  • Notice that the 3rd solution (\(d = 4\)) is \(210{,}526{,}315{,}789{,}473{,}684\)—which is the doubled result of the first solution!
  • Beyond 18 digits: Because \(10^m \equiv 1 \pmod{19}\) holds whenever \(m\) is a multiple of \(18\) (\(m = 18, 36, 54, \dots\)), the next family of solutions occurs at 36 digits. You obtain them simply by concatenating any 18-digit solution with itself. The smallest 36-digit solution is:\[105263157894736842105263157894736842\]

3. History and Discovery

While the underlying cyclic period of \(\frac{1}{19}\) was known to 18th- and 19th-century number theorists studying repeating decimals and primitive roots (including Johann Heinrich Lambert in 1769, Carl Friedrich Gauss in Disquisitiones Arithmeticae in 1801, and William Shanks in the 1850s), the specific digit-shifting puzzle has a rich recreational pedigree:

  1. Walter B. Gibson (1938) & Maurice Kraitchik (1942): The earliest documented versions of the digit-transposition puzzle in recreational literature trace to American magician and puzzle writer Walter B. Gibson in 1938, and Belgian mathematician Maurice Kraitchik, who analyzed cyclic digit-shifting multiplications in his 1942 classic Mathematical Recreations.
  2. Freeman Dyson's Table Puzzle: In the mid-20th century, physicist Freeman Dyson famously posed the problem at a mathematical gathering: "Find the smallest positive integer that doubles when its last digit is moved to the front". Because Dyson could calculate the 18-digit number mentally in a few seconds—by starting with a trailing \(2\) and repeatedly doubling right-to-left with carries (\(2 \to 42 \to 842 \to 6842 \dots\) until reaching \(1\) with no carry)—the smallest \(n\)-parasitic numbers (OEIS sequence A092697) became known as Dyson numbers.
  3. Leon Bernstein (1968): In his paper "Multiplicative twins and primitive roots" (Mathematische Zeitschrift, 1968), mathematician Leon Bernstein formalized the algebraic theory connecting these numbers directly to primitive roots and \(p\)-adic expansions.
  4. Clifford A. Pickover (2000): The term "parasitic number" was coined and popularized by science and mathematics author Clifford Pickover in Chapter 28 of his 2000 book Wonders of Numbers.
Key takeaway: The size of the smallest \(k\)-parasitic number depends entirely on the multiplicative order of \(10\) modulo \((10k - 1)\). For \(k = 2\), \(10k - 1 = 19\) is a full reptend prime, forcing an 18-digit minimum. By contrast, for \(k = 4\), \(10k - 1 = 39 = 3 \times 13\), and since \(10^6 \equiv 1 \pmod{39}\), the smallest 4-parasitic number has just 6 digits: \(102{,}564 \times 4 = 410{,}256\).

Monday, 26 October 2026

Hidden Numbers: A Generalisation

In my two previous posts, I've looked at how to find the digit sequences 666 and 888 hidden within the factorisation of certain composite numbers. However, I got Gemini to write a program that would search for any combination of digits, provided those digits form a composite number and remembering that these digits cannot appear in the originating number.

Let's take James Bond's "707" as an example. We don't want 0 or 7 to appear in the number and it can't appear in the prime factorisation because it's not prime. However, we need it to appear when we combine the prime factors in a certain way. Here was the result in the range from 4 to 40000 (permalink):


The more restrictive we make it of course the fewer numbers that turn up. Let's try with "789" (permalink):

┌────────┬─────────────────────┬────────────────────────┐
│ Number | Prime Factorisation | Adjusted Factorisation |
╞════════╪═════════════════════╪════════════════════════╡
│ 3156   | 2^2 * 3 * 263       | 2 * 2 * 789            |
├────────┼─────────────────────┼────────────────────────┤
│ 6312   | 2^3 * 3 * 263       | 2 * 2 * 2 * 789        |
├────────┼─────────────────────┼────────────────────────┤
│ 12624  | 2^4 * 3 * 263       | 2 * 2 * 2 * 2 * 789    |
├────────┼─────────────────────┼────────────────────────┤
│ 14202  | 2 * 3^3 * 263       | 2 * 3 * 3 * 789        |
├────────┼─────────────────────┼────────────────────────┤
│ 15156  | 2^2 * 3^2 * 421     | 2 * 2 * 3789           |
├────────┼─────────────────────┼────────────────────────┤
│ 20514  | 2 * 3 * 13 * 263    | 2 * 13 * 789           |
├────────┼─────────────────────┼────────────────────────┤
│ 21303  | 3^4 * 263           | 3 * 3 * 3 * 789        |
├────────┼─────────────────────┼────────────────────────┤
│ 30312  | 2^3 * 3^2 * 421     | 2 * 2 * 2 * 3789       |
├────────┼─────────────────────┼────────────────────────┤
│ 31560  | 2^3 * 3 * 5 * 263   | 2 * 2 * 2 * 5 * 789    |
├────────┼─────────────────────┼────────────────────────┤
│ 34101  | 3^4 * 421           | 3 * 3 * 3789           |
├────────┼─────────────────────┼────────────────────────┤
│ 35505  | 3^3 * 5 * 263       | 3 * 3 * 5 * 789        |
└────────┴─────────────────────┴────────────────────────┘

============================================================

Suitable numbers:
3156, 6312, 12624, 14202, 15156, 20514, 21303, 30312, 31560, 34101, 35505

Total count in range [4, 40000]: 11

These examples are just for demonstration purposes. Most of the time interest will focus around the repdigits from 111 to 999 with 666 and 888 being predominant.

Hidden Jesus Numbers

Having just posted about hidden beast numbers in Even More Hidden Beast Numbers, the algorithm that I used there can be easily modified to accommodate digit sequences other than 666. Of particular interest is the digit sequence 888 that has the following associations (copied from Gemini):

In Christian numerology and Gematria (the practice of assigning numerical values to letters), 888 is most famously known as the numerical value of the name of Jesus in the original Greek language. [1, 2]
1. The Greek Gematria of "Jesus"
In Koine Greek, the alphabet doubles as a numeral system. When you add up the letters in the Greek name for Jesus (Iēsous, ΙΗΣΟΥΣ), the sum equals 888: [1, 2]
    • Ι (Iota) = 10
    • Η (Eta) = 8
    • Σ (Sigma) = 200
    • Ο (Omicron) = 70
    • Î¥ (Upsilon) = 400
    • Σ (Sigma) = 200
    • Total = 888 [1]
2. Symbolism of the Number 8 in the Bible
Because 888 is an amplification of the digit 8, it carries the biblical meaning associated with the number eight:
    • New Beginnings and Rebirth: Seven is traditionally the number of spiritual completion (e.g., the seven days of creation), making eight the symbol for what comes after completion—a new creation, resurrection, or fresh start.
    • Resurrection: Jesus rose from the dead, and the early church often referred to the resurrection day as the "eighth day" of the week.
    • Noah’s Ark: Eight people (Noah, his wife, their three sons, and their wives) were saved through the flood to renew humanity.
    • Circumcision: Commanded under the Old Covenant to take place on the eighth day of a male child's life, symbolizing a spiritual covenant. [1, 2, 3, 4]
3. Contrast with 666
In Christian theology—specifically the Book of Revelation—666 is cited as the number of the beast, representing human imperfection, fallen systems, and evil. By contrast, 888 represents Christ's complete triumph over sin, death, and imperfection. [1]
Discernment Regarding "Angel Numbers"
While popular culture and modern numerology often label 888 as an "angel number" tied to financial abundance or material manifestation, Christian teachers typically emphasize spiritual stewardship. Rather than viewing repeated numbers as magical guarantees or independent prophecies, traditional Christian discernment urges believers to test any sign against Scripture and anchor focus on Christ rather than wealth manifestation. [1, 2]
Here is the adjusted query that I used:
Write a program in SageMath that will examine all positive, composite integers in a given range. Let the default range be from 4 to 40000. The criteria to be applied are that the number does not have "6" as a digit and neither do any of its prime factors. However, the prime factors can be combined to form a composite factor containing the digit sequence "666". Output should be a table showing the number, its prime factorisation and its adjusted factorisation. Output should also include a comma-separated list of suitable numbers along with a count of how many there are in the given range.

Here is the output (permalink):

┌────────┬──────────────────────┬────────────────────────┐
│ Number │ Prime Factorisation  │ Adjusted Factorisation │
╞════════╪══════════════════════╪════════════════════════╡
│ 1776   │ 2^4 * 3 * 37         │ 2 * 888                │
├────────┼──────────────────────┼────────────────────────┤
│ 2664   │ 2^3 * 3^2 * 37       │ 3 * 888                │
├────────┼──────────────────────┼────────────────────────┤
│ 3552   │ 2^5 * 3 * 37         │ 2 * 2 * 888            │
├────────┼──────────────────────┼────────────────────────┤
│ 3776   │ 2^6 * 59             │ 2 * 1888               │
├────────┼──────────────────────┼────────────────────────┤
│ 4440   │ 2^3 * 3 * 5 * 37     │ 5 * 888                │
├────────┼──────────────────────┼────────────────────────┤
│ 5664   │ 2^5 * 3 * 59         │ 3 * 1888               │
├────────┼──────────────────────┼────────────────────────┤
│ 5776   │ 2^4 * 19^2           │ 2 * 2888               │
├────────┼──────────────────────┼────────────────────────┤
│ 6216   │ 2^3 * 3 * 7 * 37     │ 7 * 888                │
├────────┼──────────────────────┼────────────────────────┤
│ 7104   │ 2^6 * 3 * 37         │ 2 * 2 * 2 * 888        │
├────────┼──────────────────────┼────────────────────────┤
│ 7552   │ 2^7 * 59             │ 2 * 2 * 1888           │
├────────┼──────────────────────┼────────────────────────┤
│ 7776   │ 2^5 * 3^5            │ 2 * 3888               │
├────────┼──────────────────────┼────────────────────────┤
│ 7992   │ 2^3 * 3^3 * 37       │ 3 * 3 * 888            │
├────────┼──────────────────────┼────────────────────────┤
│ 9440   │ 2^5 * 5 * 59         │ 5 * 1888               │
├────────┼──────────────────────┼────────────────────────┤
│ 9776   │ 2^4 * 13 * 47        │ 2 * 4888               │
├────────┼──────────────────────┼────────────────────────┤
│ 10656  │ 2^5 * 3^2 * 37       │ 2 * 2 * 3 * 888        │
├────────┼──────────────────────┼────────────────────────┤
│ 11544  │ 2^3 * 3 * 13 * 37    │ 13 * 888               │
├────────┼──────────────────────┼────────────────────────┤
│ 11552  │ 2^5 * 19^2           │ 2 * 2 * 2888           │
├────────┼──────────────────────┼────────────────────────┤
│ 11664  │ 2^4 * 3^6            │ 3 * 3888               │
├────────┼──────────────────────┼────────────────────────┤
│ 11776  │ 2^9 * 23             │ 2 * 5888               │
├────────┼──────────────────────┼────────────────────────┤
│ 12432  │ 2^4 * 3 * 7 * 37     │ 2 * 7 * 888            │
├────────┼──────────────────────┼────────────────────────┤
│ 13216  │ 2^5 * 7 * 59         │ 7 * 1888               │
├────────┼──────────────────────┼────────────────────────┤
│ 13320  │ 2^3 * 3^2 * 5 * 37   │ 3 * 5 * 888            │
├────────┼──────────────────────┼────────────────────────┤
│ 13776  │ 2^4 * 3 * 7 * 41     │ 2 * 6888               │
├────────┼──────────────────────┼────────────────────────┤
│ 14440  │ 2^3 * 5 * 19^2       │ 5 * 2888               │
├────────┼──────────────────────┼────────────────────────┤
│ 14664  │ 2^3 * 3 * 13 * 47    │ 3 * 4888               │
├────────┼──────────────────────┼────────────────────────┤
│ 15096  │ 2^3 * 3 * 17 * 37    │ 17 * 888               │
├────────┼──────────────────────┼────────────────────────┤
│ 15104  │ 2^8 * 59             │ 2 * 2 * 2 * 1888       │
├────────┼──────────────────────┼────────────────────────┤
│ 15552  │ 2^6 * 3^5            │ 2 * 2 * 3888           │
├────────┼──────────────────────┼────────────────────────┤
│ 15776  │ 2^5 * 17 * 29        │ 2 * 7888               │
├────────┼──────────────────────┼────────────────────────┤
│ 16992  │ 2^5 * 3^2 * 59       │ 3 * 3 * 1888           │
├────────┼──────────────────────┼────────────────────────┤
│ 17664  │ 2^8 * 3 * 23         │ 3 * 5888               │
├────────┼──────────────────────┼────────────────────────┤
│ 17760  │ 2^5 * 3 * 5 * 37     │ 2 * 2 * 5 * 888        │
├────────┼──────────────────────┼────────────────────────┤
│ 17764  │ 2^2 * 4441           │ 2 * 8882               │
├────────┼──────────────────────┼────────────────────────┤
│ 17766  │ 2 * 3^3 * 7 * 47     │ 2 * 8883               │
├────────┼──────────────────────┼────────────────────────┤
│ 17770  │ 2 * 5 * 1777         │ 2 * 8885               │
├────────┼──────────────────────┼────────────────────────┤
│ 17776  │ 2^4 * 11 * 101       │ 2 * 8888               │
├────────┼──────────────────────┼────────────────────────┤
│ 19440  │ 2^4 * 3^5 * 5        │ 5 * 3888               │
├────────┼──────────────────────┼────────────────────────┤
│ 19536  │ 2^4 * 3 * 11 * 37    │ 2 * 11 * 888           │
├────────┼──────────────────────┼────────────────────────┤
│ 19552  │ 2^5 * 13 * 47        │ 2 * 2 * 4888           │
├────────┼──────────────────────┼────────────────────────┤
│ 19776  │ 2^6 * 3 * 103        │ 2 * 9888               │
├────────┼──────────────────────┼────────────────────────┤
│ 20216  │ 2^3 * 7 * 19^2       │ 7 * 2888               │
├────────┼──────────────────────┼────────────────────────┤
│ 20424  │ 2^3 * 3 * 23 * 37    │ 23 * 888               │
├────────┼──────────────────────┼────────────────────────┤
│ 20664  │ 2^3 * 3^2 * 7 * 41   │ 3 * 6888               │
├────────┼──────────────────────┼────────────────────────┤
│ 21312  │ 2^6 * 3^2 * 37       │ 2 * 2 * 2 * 3 * 888    │
├────────┼──────────────────────┼────────────────────────┤
│ 21776  │ 2^4 * 1361           │ 2 * 10888              │
├────────┼──────────────────────┼────────────────────────┤
│ 22200  │ 2^3 * 3 * 5^2 * 37   │ 5 * 5 * 888            │
├────────┼──────────────────────┼────────────────────────┤
│ 22656  │ 2^7 * 3 * 59         │ 2 * 2 * 3 * 1888       │
├────────┼──────────────────────┼────────────────────────┤
│ 23104  │ 2^6 * 19^2           │ 2 * 2 * 2 * 2888       │
├────────┼──────────────────────┼────────────────────────┤
│ 23552  │ 2^10 * 23            │ 2 * 2 * 5888           │
├────────┼──────────────────────┼────────────────────────┤
│ 23664  │ 2^4 * 3 * 17 * 29    │ 3 * 7888               │
├────────┼──────────────────────┼────────────────────────┤
│ 23776  │ 2^5 * 743            │ 2 * 11888              │
├────────┼──────────────────────┼────────────────────────┤
│ 23976  │ 2^3 * 3^4 * 37       │ 3 * 3 * 3 * 888        │
├────────┼──────────────────────┼────────────────────────┤
│ 24440  │ 2^3 * 5 * 13 * 47    │ 5 * 4888               │
├────────┼──────────────────────┼────────────────────────┤
│ 24544  │ 2^5 * 13 * 59        │ 13 * 1888              │
├────────┼──────────────────────┼────────────────────────┤
│ 25752  │ 2^3 * 3 * 29 * 37    │ 29 * 888               │
├────────┼──────────────────────┼────────────────────────┤
│ 25776  │ 2^4 * 3^2 * 179      │ 2 * 12888              │
├────────┼──────────────────────┼────────────────────────┤
│ 25992  │ 2^3 * 3^2 * 19^2     │ 3 * 3 * 2888           │
├────────┼──────────────────────┼────────────────────────┤
│ 26432  │ 2^6 * 7 * 59         │ 2 * 7 * 1888           │
├────────┼──────────────────────┼────────────────────────┤
│ 26640  │ 2^4 * 3^2 * 5 * 37   │ 2 * 3 * 5 * 888        │
├────────┼──────────────────────┼────────────────────────┤
│ 26646  │ 2 * 3 * 4441         │ 3 * 8882               │
├────────┼──────────────────────┼────────────────────────┤
│ 26649  │ 3^4 * 7 * 47         │ 3 * 8883               │
├────────┼──────────────────────┼────────────────────────┤
│ 26652  │ 2^2 * 3 * 2221       │ 3 * 8884               │
├────────┼──────────────────────┼────────────────────────┤
│ 26655  │ 3 * 5 * 1777         │ 3 * 8885               │
├────────┼──────────────────────┼────────────────────────┤
│ 26664  │ 2^3 * 3 * 11 * 101   │ 3 * 8888               │
├────────┼──────────────────────┼────────────────────────┤
│ 26667  │ 3^2 * 2963           │ 3 * 8889               │
├────────┼──────────────────────┼────────────────────────┤
│ 27216  │ 2^4 * 3^5 * 7        │ 7 * 3888               │
├────────┼──────────────────────┼────────────────────────┤
│ 27552  │ 2^5 * 3 * 7 * 41     │ 2 * 2 * 6888           │
├────────┼──────────────────────┼────────────────────────┤
│ 27776  │ 2^7 * 7 * 31         │ 2 * 13888              │
├────────┼──────────────────────┼────────────────────────┤
│ 29304  │ 2^3 * 3^2 * 11 * 37  │ 3 * 11 * 888           │
├────────┼──────────────────────┼────────────────────────┤
│ 29440  │ 2^8 * 5 * 23         │ 5 * 5888               │
├────────┼──────────────────────┼────────────────────────┤
│ 29664  │ 2^5 * 3^2 * 103      │ 3 * 9888               │
├────────┼──────────────────────┼────────────────────────┤
│ 30192  │ 2^4 * 3 * 17 * 37    │ 2 * 17 * 888           │
├────────┼──────────────────────┼────────────────────────┤
│ 31104  │ 2^7 * 3^5            │ 2 * 2 * 2 * 3888       │
├────────┼──────────────────────┼────────────────────────┤
│ 31552  │ 2^6 * 17 * 29        │ 2 * 2 * 7888           │
├────────┼──────────────────────┼────────────────────────┤
│ 31776  │ 2^5 * 3 * 331        │ 2 * 15888              │
├────────┼──────────────────────┼────────────────────────┤
│ 32096  │ 2^5 * 17 * 59        │ 17 * 1888              │
├────────┼──────────────────────┼────────────────────────┤
│ 32664  │ 2^3 * 3 * 1361       │ 3 * 10888              │
├────────┼──────────────────────┼────────────────────────┤
│ 33744  │ 2^4 * 3 * 19 * 37    │ 2 * 19 * 888           │
├────────┼──────────────────────┼────────────────────────┤
│ 33776  │ 2^4 * 2111           │ 2 * 16888              │
├────────┼──────────────────────┼────────────────────────┤
│ 34216  │ 2^3 * 7 * 13 * 47    │ 7 * 4888               │
├────────┼──────────────────────┼────────────────────────┤
│ 34440  │ 2^3 * 3 * 5 * 7 * 41 │ 5 * 6888               │
├────────┼──────────────────────┼────────────────────────┤
│ 34632  │ 2^3 * 3^2 * 13 * 37  │ 3 * 13 * 888           │
├────────┼──────────────────────┼────────────────────────┤
│ 34656  │ 2^5 * 3 * 19^2       │ 2 * 2 * 3 * 2888       │
├────────┼──────────────────────┼────────────────────────┤
│ 34992  │ 2^4 * 3^7            │ 3 * 3 * 3888           │
├────────┼──────────────────────┼────────────────────────┤
│ 35520  │ 2^6 * 3 * 5 * 37     │ 2 * 2 * 2 * 5 * 888    │
├────────┼──────────────────────┼────────────────────────┤
│ 35532  │ 2^2 * 3^3 * 7 * 47   │ 2 * 2 * 8883           │
├────────┼──────────────────────┼────────────────────────┤
│ 35536  │ 2^4 * 2221           │ 2 * 2 * 8884           │
├────────┼──────────────────────┼────────────────────────┤
│ 35540  │ 2^2 * 5 * 1777       │ 2 * 2 * 8885           │
├────────┼──────────────────────┼────────────────────────┤
│ 35552  │ 2^5 * 11 * 101       │ 2 * 2 * 8888           │
├────────┼──────────────────────┼────────────────────────┤
│ 35556  │ 2^2 * 3 * 2963       │ 2 * 2 * 8889           │
├────────┼──────────────────────┼────────────────────────┤
│ 35664  │ 2^4 * 3 * 743        │ 3 * 11888              │
├────────┼──────────────────────┼────────────────────────┤
│ 35776  │ 2^6 * 13 * 43        │ 2 * 17888              │
├────────┼──────────────────────┼────────────────────────┤
│ 37296  │ 2^4 * 3^2 * 7 * 37   │ 2 * 3 * 7 * 888        │
├────────┼──────────────────────┼────────────────────────┤
│ 37544  │ 2^3 * 13 * 19^2      │ 13 * 2888              │
├────────┼──────────────────────┼────────────────────────┤
│ 37760  │ 2^7 * 5 * 59         │ 2 * 2 * 5 * 1888       │
├────────┼──────────────────────┼────────────────────────┤
│ 37762  │ 2 * 79 * 239         │ 2 * 18881              │
├────────┼──────────────────────┼────────────────────────┤
│ 37764  │ 2^2 * 3^2 * 1049     │ 2 * 18882              │
├────────┼──────────────────────┼────────────────────────┤
│ 37770  │ 2 * 3 * 5 * 1259     │ 2 * 18885              │
├────────┼──────────────────────┼────────────────────────┤
│ 37772  │ 2^2 * 7 * 19 * 71    │ 2 * 18886              │
├────────┼──────────────────────┼────────────────────────┤
│ 37774  │ 2 * 11 * 17 * 101    │ 2 * 18887              │
├────────┼──────────────────────┼────────────────────────┤
│ 39072  │ 2^5 * 3 * 11 * 37    │ 2 * 2 * 11 * 888       │
├────────┼──────────────────────┼────────────────────────┤
│ 39104  │ 2^6 * 13 * 47        │ 2 * 2 * 2 * 4888       │
├────────┼──────────────────────┼────────────────────────┤
│ 39440  │ 2^4 * 5 * 17 * 29    │ 5 * 7888               │
├────────┼──────────────────────┼────────────────────────┤
│ 39552  │ 2^7 * 3 * 103        │ 2 * 2 * 9888           │
├────────┼──────────────────────┼────────────────────────┤
│ 39776  │ 2^5 * 11 * 113       │ 2 * 19888              │
├────────┼──────────────────────┼────────────────────────┤
│ 39960  │ 2^3 * 3^3 * 5 * 37   │ 3 * 3 * 5 * 888        │ 


Suitable numbers: 

1776, 2664, 3552, 3776, 4440, 5664, 5776, 6216, 7104, 7552, 7776, 7992, 9440, 9776, 10656, 11544, 11552, 11664, 11776, 12432, 13216, 13320, 13776, 14440, 14664, 15096, 15104, 15552, 15776, 16992, 17664, 17760, 17764, 17766, 17770, 17776, 19440, 19536, 19552, 19776, 20216, 20424, 20664, 21312, 21776, 22200, 22656, 23104, 23552, 23664, 23776, 23976, 24440, 24544, 25752, 25776, 25992, 26432, 26640, 26646, 26649, 26652, 26655, 26664, 26667, 27216, 27552, 27776, 29304, 29440, 29664, 30192, 31104, 31552, 31776, 32096, 32664, 33744, 33776, 34216, 34440, 34632, 34656, 34992, 35520, 35532, 35536, 35540, 35552, 35556, 35664, 35776, 37296, 37544, 37760, 37762, 37764, 37770, 37772, 37774, 39072, 39104, 39440, 39552, 39776, 39960 

Total count in range [4, 40000]: 106

Even More Hidden Beast Numbers

In a post titled Hidden Beast Numbers from the 6th August 2023 (Hiroshima Day), I looked at numbers whose sum of prime factors (with and without multiplicity) add to 666. An example would be 998515 where$$ \begin{align} 998515 = 5 \times 7 \times 47 \times 607\\5+7+47+607=666 \end{align}$$In a later post titled More Hidden Beast Numbers from the 21st August 2024, I looked at numbers where the digit sequence 666 shows up when they are rendered in other bases. An example would be 27534 where$$39862_{10}=115666_8$$Today, the number associated with my diurnal age (28330) has the property that$$ \begin{align} 28330 &=2 \times 5 \times 2833 \\ &=5 \times 5666 \end{align}$$I got Gemini to write a program using the following prompt:

Write a program in SageMath that will examine all positive, composite integers in a given range. Let the default range be from 4 to 40000. The criteria to be applied are that the number does not have "6" as a digit and neither do any of its prime factors. However, the prime factors can be combined to form a composite factor containing the digit sequence "666". An example would be 28330 = 2 * 5 * 2833. When factored as 5 * 5666, the factor "5666" contains the digit sequence "666". Output should be a table showing the number, its prime factorisation and its adjusted factorisation. Output should also include a comma-separated list of suitable numbers along with a count of how many there are in the given range.

Here is the output (permalink):

│ Number │ Prime Factorisation  │ Adjusted Factorisation  │
╞════════╪══════════════════════╪═════════════════════════╡
│ 1332   │ 2^2 * 3^2 * 37       │ 2 * 666                 │
├────────┼──────────────────────┼─────────────────────────┤
│ 1998   │ 2 * 3^3 * 37         │ 3 * 666                 │
├────────┼──────────────────────┼─────────────────────────┤
│ 3330   │ 2 * 3^2 * 5 * 37     │ 5 * 666                 │
├────────┼──────────────────────┼─────────────────────────┤
│ 3332   │ 2^2 * 7^2 * 17       │ 2 * 1666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 4998   │ 2 * 3 * 7^2 * 17     │ 3 * 1666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 5328   │ 2^4 * 3^2 * 37       │ 2 * 2 * 2 * 666         │
├────────┼──────────────────────┼─────────────────────────┤
│ 5332   │ 2^2 * 31 * 43        │ 2 * 2666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 5994   │ 2 * 3^4 * 37         │ 3 * 3 * 666             │
├────────┼──────────────────────┼─────────────────────────┤
│ 7332   │ 2^2 * 3 * 13 * 47    │ 2 * 3666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 7992   │ 2^3 * 3^3 * 37       │ 2 * 2 * 3 * 666         │
├────────┼──────────────────────┼─────────────────────────┤
│ 7998   │ 2 * 3 * 31 * 43      │ 3 * 2666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 8330   │ 2 * 5 * 7^2 * 17     │ 5 * 1666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 9324   │ 2^2 * 3^2 * 7 * 37   │ 2 * 7 * 666             │
├────────┼──────────────────────┼─────────────────────────┤
│ 9332   │ 2^2 * 2333           │ 2 * 4666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 9990   │ 2 * 3^3 * 5 * 37     │ 3 * 5 * 666             │
├────────┼──────────────────────┼─────────────────────────┤
│ 10998  │ 2 * 3^2 * 13 * 47    │ 3 * 3666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 11322  │ 2 * 3^2 * 17 * 37    │ 17 * 666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 11332  │ 2^2 * 2833           │ 2 * 5666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 11988  │ 2^2 * 3^4 * 37       │ 2 * 3 * 3 * 666         │
├────────┼──────────────────────┼─────────────────────────┤
│ 13320  │ 2^3 * 3^2 * 5 * 37   │ 2 * 2 * 5 * 666         │
├────────┼──────────────────────┼─────────────────────────┤
│ 13324  │ 2^2 * 3331           │ 2 * 6662                │
├────────┼──────────────────────┼─────────────────────────┤
│ 13328  │ 2^4 * 7^2 * 17       │ 2 * 2 * 2 * 1666        │
├────────┼──────────────────────┼─────────────────────────┤
│ 13330  │ 2 * 5 * 31 * 43      │ 5 * 2666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 13332  │ 2^2 * 3 * 11 * 101   │ 2 * 6666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 13334  │ 2 * 59 * 113         │ 2 * 6667                │
├────────┼──────────────────────┼─────────────────────────┤
│ 13338  │ 2 * 3^3 * 13 * 19    │ 2 * 6669                │
├────────┼──────────────────────┼─────────────────────────┤
│ 13998  │ 2 * 3 * 2333         │ 3 * 4666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 14994  │ 2 * 3^2 * 7^2 * 17   │ 3 * 3 * 1666            │
├────────┼──────────────────────┼─────────────────────────┤
│ 15318  │ 2 * 3^2 * 23 * 37    │ 23 * 666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 15332  │ 2^2 * 3833           │ 2 * 7666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 15984  │ 2^4 * 3^3 * 37       │ 2 * 2 * 2 * 3 * 666     │
├────────┼──────────────────────┼─────────────────────────┤
│ 17982  │ 2 * 3^5 * 37         │ 3 * 3 * 3 * 666         │
├────────┼──────────────────────┼─────────────────────────┤
│ 18330  │ 2 * 3 * 5 * 13 * 47  │ 5 * 3666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 19314  │ 2 * 3^2 * 29 * 37    │ 29 * 666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 19332  │ 2^2 * 3^3 * 179      │ 2 * 9666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 19980  │ 2^2 * 3^3 * 5 * 37   │ 2 * 3 * 5 * 666         │
├────────┼──────────────────────┼─────────────────────────┤
│ 19989  │ 3^2 * 2221           │ 3 * 6663                │
├────────┼──────────────────────┼─────────────────────────┤
│ 19992  │ 2^3 * 3 * 7^2 * 17   │ 2 * 2 * 3 * 1666        │
├────────┼──────────────────────┼─────────────────────────┤
│ 19995  │ 3 * 5 * 31 * 43      │ 3 * 6665                │
├────────┼──────────────────────┼─────────────────────────┤
│ 19998  │ 2 * 3^2 * 11 * 101   │ 3 * 6666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 20001  │ 3 * 59 * 113         │ 3 * 6667                │
├────────┼──────────────────────┼─────────────────────────┤
│ 20007  │ 3^4 * 13 * 19        │ 3 * 6669                │
├────────┼──────────────────────┼─────────────────────────┤
│ 21312  │ 2^6 * 3^2 * 37       │ 2 * 2 * 2 * 2 * 2 * 666 │
├────────┼──────────────────────┼─────────────────────────┤
│ 21328  │ 2^4 * 31 * 43        │ 2 * 2 * 2 * 2666        │
├────────┼──────────────────────┼─────────────────────────┤
│ 21332  │ 2^2 * 5333           │ 2 * 10666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 21978  │ 2 * 3^3 * 11 * 37    │ 3 * 11 * 666            │
├────────┼──────────────────────┼─────────────────────────┤
│ 22998  │ 2 * 3 * 3833         │ 3 * 7666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 23310  │ 2 * 3^2 * 5 * 7 * 37 │ 5 * 7 * 666             │
├────────┼──────────────────────┼─────────────────────────┤
│ 23324  │ 2^2 * 7^3 * 17       │ 2 * 7 * 1666            │
├────────┼──────────────────────┼─────────────────────────┤
│ 23330  │ 2 * 5 * 2333         │ 5 * 4666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 23332  │ 2^2 * 19 * 307       │ 2 * 11666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 23994  │ 2 * 3^2 * 31 * 43    │ 3 * 3 * 2666            │
├────────┼──────────────────────┼─────────────────────────┤
│ 24990  │ 2 * 3 * 5 * 7^2 * 17 │ 3 * 5 * 1666            │
├────────┼──────────────────────┼─────────────────────────┤
│ 25308  │ 2^2 * 3^2 * 19 * 37  │ 2 * 19 * 666            │
├────────┼──────────────────────┼─────────────────────────┤
│ 25332  │ 2^2 * 3 * 2111       │ 2 * 12666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 25974  │ 2 * 3^3 * 13 * 37    │ 3 * 13 * 666            │
├────────┼──────────────────────┼─────────────────────────┤
│ 27972  │ 2^2 * 3^3 * 7 * 37   │ 2 * 3 * 7 * 666         │
├────────┼──────────────────────┼─────────────────────────┤
│ 28322  │ 2 * 7^2 * 17^2       │ 17 * 1666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 28330  │ 2 * 5 * 2833         │ 5 * 5666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 28998  │ 2 * 3^4 * 179        │ 3 * 9666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 29304  │ 2^3 * 3^2 * 11 * 37  │ 2 * 2 * 11 * 666        │
├────────┼──────────────────────┼─────────────────────────┤
│ 29328  │ 2^4 * 3 * 13 * 47    │ 2 * 2 * 2 * 3666        │
├────────┼──────────────────────┼─────────────────────────┤
│ 29332  │ 2^2 * 7333           │ 2 * 14666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 29970  │ 2 * 3^4 * 5 * 37     │ 3 * 3 * 5 * 666         │
├────────┼──────────────────────┼─────────────────────────┤
│ 29988  │ 2^2 * 3^2 * 7^2 * 17 │ 2 * 3 * 3 * 1666        │
├────────┼──────────────────────┼─────────────────────────┤
│ 31302  │ 2 * 3^2 * 37 * 47    │ 47 * 666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 31332  │ 2^2 * 3 * 7 * 373    │ 2 * 15666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 31992  │ 2^3 * 3 * 31 * 43    │ 2 * 2 * 3 * 2666        │
├────────┼──────────────────────┼─────────────────────────┤
│ 31998  │ 2 * 3 * 5333         │ 3 * 10666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 32994  │ 2 * 3^3 * 13 * 47    │ 3 * 3 * 3666            │
├────────┼──────────────────────┼─────────────────────────┤
│ 33300  │ 2^2 * 3^2 * 5^2 * 37 │ 2 * 5 * 5 * 666         │
├────────┼──────────────────────┼─────────────────────────┤
│ 33310  │ 2 * 5 * 3331         │ 5 * 6662                │
├────────┼──────────────────────┼─────────────────────────┤
│ 33315  │ 3 * 5 * 2221         │ 5 * 6663                │
├────────┼──────────────────────┼─────────────────────────┤
│ 33320  │ 2^3 * 5 * 7^2 * 17   │ 2 * 2 * 5 * 1666        │
├────────┼──────────────────────┼─────────────────────────┤
│ 33324  │ 2^2 * 3 * 2777       │ 2 * 16662               │
├────────┼──────────────────────┼─────────────────────────┤
│ 33325  │ 5^2 * 31 * 43        │ 5 * 6665                │
├────────┼──────────────────────┼─────────────────────────┤
│ 33328  │ 2^4 * 2083           │ 2 * 16664               │
├────────┼──────────────────────┼─────────────────────────┤
│ 33330  │ 2 * 3 * 5 * 11 * 101 │ 5 * 6666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 33334  │ 2 * 7 * 2381         │ 2 * 16667               │
├────────┼──────────────────────┼─────────────────────────┤
│ 33335  │ 5 * 59 * 113         │ 5 * 6667                │
├────────┼──────────────────────┼─────────────────────────┤
│ 33338  │ 2 * 79 * 211         │ 2 * 16669               │
├────────┼──────────────────────┼─────────────────────────┤
│ 33345  │ 3^3 * 5 * 13 * 19    │ 5 * 6669                │
├────────┼──────────────────────┼─────────────────────────┤
│ 34998  │ 2 * 3 * 19 * 307     │ 3 * 11666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 35298  │ 2 * 3^2 * 37 * 53    │ 53 * 666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 35332  │ 2^2 * 11^2 * 73      │ 2 * 17666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 37324  │ 2^2 * 7 * 31 * 43    │ 2 * 7 * 2666            │
├────────┼──────────────────────┼─────────────────────────┤
│ 37328  │ 2^4 * 2333           │ 2 * 2 * 2 * 4666        │
├────────┼──────────────────────┼─────────────────────────┤
│ 37998  │ 2 * 3^2 * 2111       │ 3 * 12666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 38318  │ 2 * 7^2 * 17 * 23    │ 23 * 1666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 38330  │ 2 * 5 * 3833         │ 5 * 7666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 39294  │ 2 * 3^2 * 37 * 59    │ 59 * 666                │
├────────┼──────────────────────┼─────────────────────────┤
│ 39332  │ 2^2 * 9833           │ 2 * 19666               │
├────────┼──────────────────────┼─────────────────────────┤
│ 39972  │ 2^2 * 3 * 3331       │ 2 * 3 * 6662            │
├────────┼──────────────────────┼─────────────────────────┤
│ 39978  │ 2 * 3^2 * 2221       │ 2 * 3 * 6663            │
├────────┼──────────────────────┼─────────────────────────┤
│ 39984  │ 2^4 * 3 * 7^2 * 17   │ 2 * 2 * 2 * 3 * 1666    │
├────────┼──────────────────────┼─────────────────────────┤
│ 39990  │ 2 * 3 * 5 * 31 * 43  │ 3 * 5 * 2666            │
└────────┴──────────────────────┴─────────────────────────┘

Suitable numbers: 
 
1332, 1998, 3330, 3332, 4998, 5328, 5332, 5994, 7332, 7992, 7998, 8330, 9324, 9332, 9990, 10998, 11322, 11332, 11988, 13320, 13324, 13328, 13330, 13332, 13334, 13338, 13998, 14994, 15318, 15332, 15984, 17982, 18330, 19314, 19332, 19980, 19989, 19992, 19995, 19998, 20001, 20007, 21312, 21328, 21332, 21978, 22998, 23310, 23324, 23330, 23332, 23994, 24990, 25308, 25332, 25974, 27972, 28322, 28330, 28998, 29304, 29328, 29332, 29970, 29988, 31302, 31332, 31992, 31998, 32994, 33300, 33310, 33315, 33320, 33324, 33325, 33328, 33330, 33334, 33335, 33338, 33345, 34998, 35298, 35332, 37324, 37328, 37998, 38318, 38330, 39294, 39332, 39972, 39978, 39984, 39990 
 
Total count in range [4, 40000]: 96