OFFSET
0,2
COMMENTS
"Leading zeros" means "zeros on the left".
21 -> 110 -> 21 is the first loop, when this operation is iterated. Another is 22 -> 200 -> 102 -> 111 -> 30 -> 1001 -> 22.
Suggested by an email from Allan C. Wechsler.
The numbers 2, 3, ..., 9 cannot appear, but 1 and all k >= 10 are terms. Specifically, if the decimal digits of k > 0 are d0^c, where d is a single nonzero digit and 0^c is a string of c > 0 concatenated 0's, then k appears as a(1^(d*10**(c-1))); otherwise, if the decimal digits of k are d0^cb where d and c are as before but c >= 0 and b is a string of digits not starting with 0, then k appears as a(1^(d*10^c) 0^b). - Michael S. Branicky, Nov 14 2021
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..9999
EXAMPLE
0 -> 1
1 -> 10
2 -> 100
3 -> 1000 (one 3, zero copies of 2, 1, 0, so 1 0 0 0)
4 -> 10000
5 -> 100000
6 -> 1000000
7 -> 10000000
8 -> 100000000
9 -> 1000000000
10 -> 11
11 -> 20
12 -> 110
...
2222222222 -> 1000 (ten 2's, zero 1's, zero 0's, so 10 0 0)
...
MATHEMATICA
Array[FromDigits@*RotateLeft@*Reverse@*DigitCount, 35, 0] (* Giorgos Kalogeropoulos, Nov 15 2021 *)
PROG
(Python)
def a(n):
s = str(n)
return int("".join(str(s.count(d)) for d in "9876543210").lstrip("0"))
print([a(n) for n in range(35)]) # Michael S. Branicky, Nov 14 2021
(PARI) apply( {A348783(n)=if(n, eval(concat([Str(#[0|d<-n, d==i])|i<-+-[-vecmax(n=digits(n))..0]])), 1)}, [0..66]) \\ M. F. Hasler, Nov 15 2021
CROSSREFS
KEYWORD
AUTHOR
N. J. A. Sloane, Nov 14 2021
EXTENSIONS
More terms from Michael S. Branicky, Nov 14 2021
STATUS
approved