Zero-avoiding numbers in many bases

18 views
Skip to first unread message

Ven Popov (Ven)

unread,
Dec 3, 2025, 9:12:06 AM (2 days ago) Dec 3
to SeqFan
Call a number k "n-zero-avoiding", if it doesn't contain the digit 0 in any base b, n <= b < k. Let S(n) be the set of all n-zero-avoiding numbers (with the trivial numbers less than n excluded).

- What are the values for S(n)?
- How big are these sets: |S(n)|? Are they all finite?
- If they are finite, what is M(n) = max(S(n))

## Small case analysis

### n = 2

S(2) contains all numbers that have no 0 in their binary, ternary and all higher bases expansions. This means all elements are Mersene numbers of the form 2^m - 1. The number 3 is in S(2) because we only need to check base 2. Large computational search considering only base 2 and 3 suggests that the only non-trivial Mersene numbers that avoid 0s in ternary are {7, 32768}. Of those, only 7 is in S(2). We have:

3 = 11_2
7 = 111_2 = 21_3 = 13_4 = 12_5 = 11_6
32768 = 1122221121_3 = 13333333_4 = 2022032_5 (fails at base 5)

S(2) ?= {3, 7}

### n = 3

Relaxing the base-2 restriction expands the space a little. S(3) is listed with 8 elements in https://oeis.org/A069575 but is conjectured to be finite as well (reportedly checked up to 10^400).

S(3) ?= {4, 5, 7, 13, 23, 43, 157, 619}

### n > 3

Here are computational results (up to 10^10) for the next few n. Like n = 2 or 3, these also appear to be finite:

|S(4)| ?= 20
|S(5)| ?= 42
|S(6)| ?= 78
|S(7)| ?= 115
|S(8)| ?= 163
|S(9)| ?= 222
|S(10)| ?= 301
|S(11)| ?= 391
|S(12)| ?= 524

(thought S(11) and S(12) max found elements are 1/10 of the upper search limit, so there might be more terms)

S(4) ?= {5, 6, 7, 9, 11, 13, 23, 31, 43, 47, 59, 61, 157, 191, 421, 431, 619, 997, 1663, 26237}

S(5):
- First 20: [6, 7, 8, 9, 11, 13, 17, 19, 23, 31, 43, 47, 59, 61, 97, 157, 191, 211, 281, 283]
- Last 10: [11411, 11437, 11443, 11447, 25819, 26237, 38287, 76463, 113963, 698531]

S(6):
First 20: [7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 25, 29, 31, 43, 47, 59, 61, 79, 97, 137]
Last 10: [38287, 76463, 113963, 678631, 678647, 678649, 698531, 1393739, 3979427, 3979433]

S(7):
First 20: [8, 9, 10, 11, 12, 13, 15, 17, 19, 23, 25, 29, 31, 37, 41, 43, 47, 59, 61, 73]
Last 10: [678641, 678647, 678649, 698339, 698531, 1393739, 1393817, 3974291, 3979427, 3979433]

S(8):
First 20: [9, 10, 11, 12, 13, 14, 15, 17, 19, 21, 23, 25, 29, 31, 35, 37, 41, 43, 47, 49]
Last 10: [899693, 899711, 1393739, 1393817, 1396183, 1396189, 3974291, 3979427, 3979433, 3979499]

S(9):
First 20: [10, 11, 12, 13, 14, 15, 16, 17, 19, 21, 23, 25, 29, 31, 35, 37, 41, 43, 47, 49]
Last 10: [1396183, 1396189, 3974279, 3974291, 3979427, 3979433, 3979499, 4383779, 4383791, 4383817]

S(10):
First 20: [11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 27, 29, 31, 35, 37, 41, 43, 47]
Last 10: [4383419, 4383439, 4383443, 4383779, 4383791, 4383817, 13415117, 13415119, 18189421, 18189427]

S(11):
First 20: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 27, 29, 31, 35, 37, 41, 43, 47]
Last 10: [10856959, 11021371, 11021383, 13415117, 13415119, 18189421, 18189427, 22095167, 1017398581, 1017398749]

S(12):
First 20: [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 27, 29, 31, 33, 35, 37, 41, 43]
Last 10: [26686901, 26686903, 54670117, 54670129, 164910121, 164910167, 1017398581, 1017398749, 1397381441, 1397387987]

Conjecture: all S(n) are finite.

## Prime bases only

Instead of requiring a number to be zero-avoiding in all bases in a range, limit to only prime bases. If we include base 2, we don't gain anything, so consider all prime bases higher than 2.

Numbers k that have no 0 digit in any prime base p, 2 < p < k
Max Scan Limit: 10^12
—————————————————
Conjecture: infinite sequence

3, 5, 7, 13, 17, 23, 41, 43, 67, 71, 157, 211, 233, 239, 241, 449, 457, 617, 619, 1123, 1831, 4283, 4289, 4373, 5471, 10607, 56039, 56041, 56123, 109313, 117041, 117043, 148361, 154183, 154211, 154213, 154291, 155167, 155191, 351097, 351121, 530359, 1055959, 1056047, 1056073, 1355857, 1357043, 1357063, 1388461, 1388743, 1389919, 1525787, 1526191, 2637169, 2654909, 2929741, 2930219, 3122671, 7374293, 7381097, 7708333, 8796083, 8849969, 9366839, 9499319, 9558293, 13552811, 13571431, 13571539, 13571783, 13573697, 13573723, 13573949, 26552087, 26917339, 27082997, 27927247, 27927743, 27927959, 27927961, 36117467, 38024369, 38024549, 38024557, 38027443, 38083571, 210264709, 210271183, 210271189, 210382721, 210382807, 210383963, 210383969, 210388307, 212870797, 238964731, 238964741, 238968061, 337287121, 337444999, 337445341, 385760437, 385764839, 712633099, 712633111, 1098223559, 1098226097, 1099354247, 1878092473, 1917180247, 1917888919, 1917889297, 1920916421, 2308316443, 2308316449, 2308317169, 2308317181, 3049326781, 3054007709, 3343227493, 3356926163, 3356926169, 3357386059, 3357399209, 5809683497, 5809683569, 5809683571, 5809684337, 8865968611, 9167150911, 9167288363, 30169115293, 30170427439, 30170430331, 30170430449, 30174964069, 50751484061, 50751484087, 59254429037, 59254429193, 59260451461, 82343338331, 89491921873, 90077055907, 90077058031, 90077061731, 90077061743, 90077102987, 90077103049, 90077632213, 90077632217, 90077632243, 90204600793, 90204600797

Note that all elements are prime. The gaps keep increasing, but every time I bump up the search limit I find new ones so far.

If we make the strong (and likely wrong) assumption that digit distributions in different bases are random, there are simple arguments that can be made to defend both the finiteness of all S(n), and the infinitude of the prime version. The distribution of primes is just sparse enough that the expected value of the the number of zero avoiding numbers diverges.

Interested in further thoughts on this and also whether any of these are worth submitting (the prime one is the most interesting to me)

Fred Lunnon

unread,
Dec 3, 2025, 10:01:06 AM (2 days ago) Dec 3
to seq...@googlegroups.com
<< ... the only non-trivial Mersene numbers that avoid 0s in ternary are {7, 32768} >>  ?! 


--
You received this message because you are subscribed to the Google Groups "SeqFan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/df1966f0-919c-4b63-8523-2a02dab14d07n%40googlegroups.com.

M F Hasler

unread,
Dec 3, 2025, 10:09:09 AM (2 days ago) Dec 3
to seq...@googlegroups.com
On Wed, Dec 3, 2025, 10:12 Ven Popov (Ven) <vencisl...@gmail.com> wrote:
Call a number k "n-zero-avoiding", if it doesn't contain the digit 0 in any base b, n <= b < k. Let S(n) be the set of all n-zero-avoiding numbers with the trivial numbers less than n excluded.

Mersene numbers that avoid 0s in ternary are {7, 32768}.

You certainly mean 32767 (corresponding to the base-4 expansion shown below):

3 = 11_2
7 = 111_2 = 21_3 = 13_4 = 12_5 = 11_6
32768 = 1122221121_3 = 13333333_4 = 2022032_5 (fails at base 5)
So S(2) = {3, 7}.

It's easy to see that no zero digit in base b => no zero digit in any base b^m (for example, 11...1 in binary gives ...3333 in base 4 and ...777 in base 8 etc. 
Essentially, in base b^m the digits are made of m base-b digits.

S(3) is listed with 8 elements in https://oeis.org/A069575 but is conjectured to be finite as well (reportedly checked up to 10^400).

Up to 10^5000, actually!
...

S(6):
First 20: [7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 25, 29, 31, 43, 47, 59, 61, 79, 97, 137]

Obviously the first n-1 numbers are always n+1 ... 2n-1,
then come the odd numbers from 2n+1 and less than 3n.

Numbers k that have no 0 digit in any prime base p, 2 < p < k

3, 5, 7, 13, 17, 23, 41, 43, 67, 71, 157, 211, 233, 239, 241, 449, 457, 617,...

any of these are worth submitting

The last one, certainly.

The others, maybe as just one table?
Either as infinite square matrix read by antidiagonals, with row n = S(n), followed with zeros after the last element ?
Or, "read by rows", restricting S(n) to numbers below some fixed bound L(n) which should be chosen as a generous conjectured upper bound of max S(n):
That way the table is well defined and effectively comptable, and still we have best chances that the rows are actually complete.

Maximilian

Ven Popov

unread,
Dec 3, 2025, 10:10:11 AM (2 days ago) Dec 3
to seq...@googlegroups.com
that was a typo, sorry, it should be 32767
--
You received this message because you are subscribed to a topic in the Google Groups "SeqFan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/seqfan/PqQLpJ4_9b4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/CAN57YqsxJz60O74p1JxDfyj4fkOSyf2oCXLjb5sjFMXw9FO7rA%40mail.gmail.com.
 

Daniel Mondot

unread,
Dec 3, 2025, 1:48:04 PM (2 days ago) Dec 3
to seq...@googlegroups.com
1, 7, and 32767 or 2^1-1, 2^3-1, and 2^15-1 seem to be the only Mersenne numbers that do not contain a zero in ternary.
I verified that up to 2^2000000 (or 10^602060), and I can probably push that search a little further such as up to 2^100000000...

I think it might theoretically be easier to prove that, but looking at the fact that with each successive number, the value of their nth digit goes through a cycle that repeats every 3^n
However, by some estimations, it would take a large amount of memory and time to do so.
For instance... 
The first zero for 2^511773-1 is at digit 32 (starting from the lowest digit), so it would take at a minimum 617673396283947 cycles to check that there is at least one zero in the last 32 digits of each number, and that could take 388101700134 years.

Hopefully there is a better way to do this.

Daniel.

Reply all
Reply to author
Forward
0 new messages