login
A380985
Numbers whose k-th digit indicates the number of digits which occur k times.
1
1, 20, 110, 2100, 20100, 200100, 2000100, 20000100, 200000100, 2000000100, 20000000100, 200000000100, 2000000000100, 20000000000100, 200000000000100, 2000000000000100, 20000000000000100, 200000000000000100, 2000000000000000100, 20000000000000000100
OFFSET
1,2
COMMENTS
The most significant digit is digit position k=1, meaning that it counts how many numbers appear 1 time.
FORMULA
a(n) = 2*10^(n-1) + 100 for n >= 4. - Andrew Howroyd, Feb 22 2025
G.f.: x*(1 + 9*x - 100*x^2 + 1090*x^3 - 1900*x^4)/((1 - x)*(1 - 10*x)). - Andrew Howroyd, Nov 13 2025
EXAMPLE
110 is a term because 1 number appears once (0), 1 number appears twice (1) and 0 numbers appear 3 times.
MATHEMATICA
LinearRecurrence[{11, -10}, {1, 20, 110, 2100, 20100}, 20] (* Paolo Xausa, Nov 13 2025 *)
PROG
(Python)
from collections import Counter
def ok(n):
d = list(map(int, str(n)))
c = Counter(Counter(d).values())
return all(dk == c[k] for k, dk in enumerate(d, 1)) # Michael S. Branicky, Feb 18 2025
(PARI) a(n) = if(n < 4, [1, 20, 110][n], 2*10^(n-1) + 100) \\ Andrew Howroyd, Nov 13 2025
CROSSREFS
Cf. A046043.
Sequence in context: A008383 A384334 A024192 * A309781 A228243 A086605
KEYWORD
nonn,easy,base
AUTHOR
Leo Crabbe, Feb 11 2025
STATUS
approved