cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A342829 a(n) is the smallest number whose sum of digits is equal to the sum of digits of n.

Original entry on oeis.org

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

Views

Author

Michel Marcus, Mar 23 2021

Keywords

Examples

			For n=10, A007953(10) = 1, and 1 is the smallest integer x satisfying A007953(x)=1, so a(10)=1.
		

Crossrefs

Cf. A007953 (sum of digits), A051885.

Programs

  • PARI
    a(n) = my(k=1, s=sumdigits(n)); while(sumdigits(k) != s, k++); k;

Formula

a(n) = A051885(A007953(n)).