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.

No comments:

Post a Comment