# Consecutive numbers which use all digits a different number of times

Are there arbitrarily long sets of consecutive numbers such that when writing the set down, every single digit (0 to 9) is used a different number of times?

• Define Arbitrarily long Apr 30, 2020 at 4:33
• @Ankit: As long as I wish. Apr 30, 2020 at 4:36
• And what does that mean? @BernardoRecamánSantos Apr 30, 2020 at 4:37
• – JMP
Apr 30, 2020 at 5:09

Yes.

To get a consecutive string of $$10^n$$ numbers with different digit counts, just take your starting point to be "122333444455555666666777777788888888999999990...0", with $$n$$ zeroes at the end.

In your $$10^n$$ numbers, the last digits will just count up from $$1$$ to $$10^n$$. Each of those positions will be any chosen value exactly a tenth of the time. So, since the prefixes are consistently unequally distributed, and the suffixes balance out to become equally distributed, the total count of all the digits will be unequally distributed.
(Specifically, the digit $$d$$ will appear $$10^{n-1}+d10^{n}$$ times.)

• Beat me! I think the sequence of numbers from $1$ to $10000...00987654321$ will also satisfy this for a sufficiently large number of zeroes.
– Anon
Apr 30, 2020 at 5:08
• In that case it would be interesting to find which is the least N such that a different number of each of the ten digits is used to write down numbers 1, 2, 3, ..., N. Apr 30, 2020 at 14:24
• @BernardoRecamánSantos Assuming I'm interpreting this correctly, I don't think you can go lower than 100000000011111112222222333333444445555666778. That's zero 9s, one 8, two 7s, etc., up to eight 1s and nine 0s, front-loading the smallest values in the most significant digits. If we're allowed to count leading 0s, you could make that 000000000111111112222222333333444445555666778, which is a lot smaller. If you require each digit to be used at least once, then it's 1000000000011111111222222223333333444444555556666777889 or 0000000000111111111222222223333333444444555556666777889 Apr 30, 2020 at 15:23
• @DarrelHoffman: I mean writing down all the numbers from 1 to N, not just N. Apr 30, 2020 at 15:26
• The matter has now been settled: math.stackexchange.com/questions/3652336/… May 1, 2020 at 0:05

Yes.

I believe this that is true with binary numbers starting from 1:
number [total ones, total zeros]
1 [1,0]
10 [2,1]
11 [4,1]
100 [5,3]
101 [7,4]

The number of 0's will never catch up to the number of 1's.

• Welcome Shawn! Nice start! Apr 30, 2020 at 4:48