login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A263019
If n is the i-th positive integer with digital sum j, then a(n) is the j-th positive integer with digital sum i.
1
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 2, 11, 20, 101, 110, 200, 1001, 1010, 1100, 1000000000, 12, 21, 30, 102, 111, 120, 201, 210, 2000, 10000000000, 22, 31, 40, 103, 112, 121, 130, 300, 10001, 100000000000, 32, 41, 50, 104, 113, 122
OFFSET
1,2
COMMENTS
Digital sum is given by A007953.
This is a self-inverse permutation of the natural numbers, with fixed points A081927.
A007953(n) = A081927(a(n)) for any n>0.
A081927(n) = A007953(a(n)) for any n>0.
a(A051885(n)) = 10^(n-1) for any n>0.
a(10^(n-1)) = A051885(n) for any n>0.
PROG
(PARI) a(n) = {j = sumdigits(n); v = vector(n, k, sumdigits(k)); i = #select(x->x==j, v); nb = 0; k = 0; while(nb != j, k++; if (sumdigits(k) == i, nb++)); k; } \\ Michel Marcus, Oct 16 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paul Tek, Oct 07 2015
STATUS
approved