A342829 a(n) is the smallest number whose sum of digits is equal to the sum of digits of n.
1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 8
Offset: 1
Examples
For n=10, A007953(10) = 1, and 1 is the smallest integer x satisfying A007953(x)=1, so a(10)=1.
Links
- Michel Marcus, Table of n, a(n) for n = 1..10000
Programs
-
PARI
a(n) = my(k=1, s=sumdigits(n)); while(sumdigits(k) != s, k++); k;