A344486 a(n) is the least k such that the sum of digits of k is a substring of n and the sum of digits of n is a substring of k.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 29, 39, 49, 59, 69, 79, 89, 99, 10, 2, 399, 499, 599, 699, 799, 899, 999, 101, 11, 3, 4999, 5999, 6999, 7999, 8999, 9999, 102, 111, 12, 4, 59999, 69999, 79999, 89999, 99999, 103, 112, 112, 13, 5, 699999, 799999, 899999, 999999
Offset: 0
Examples
For n = 11: - the sum of digits of 11 is 2, - the sum of digits of a(n) must equal 1 or 11, - the numbers whose sum of digits is 1 are the powers of 10, - 2 cannot be a substring of a power of 10, - the first number with sum of digits 11 is 29, - 2 is a substring of 29, - so a(11) = 29.
Links
- Rémy Sigrist, Perl program for A344486
Programs
-
Perl
See Links section.
Formula
a(10 * n) = a(n).
Comments