login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A161561 The smallest number larger than n with digital sum equal to n. 0
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = min{k>n: A007953(k) = n}.
EXAMPLE
a(4)=13 because the sums of digits of the candidates 5 to 12 are all different from n=4, and 13 is the first candidate with sum 1+3 = n = 4.
MATHEMATICA
dsn[n_]:=Module[{k=n+1}, While[Total[IntegerDigits[k]]!=n, k++]; k]; Array[ dsn, 50] (* Harvey P. Dale, Oct 24 2020 *)
PROG
(PARI) a(n) = my(m = n+1); while(sumdigits(m) != n, m++); m; \\ Michel Marcus, Jun 08 2014
CROSSREFS
Sequence in context: A011531 A257946 A070839 * A307560 A007959 A102492
KEYWORD
base,easy,nonn
AUTHOR
Enoch Haga, Jun 13 2009
EXTENSIONS
More precise definition from R. J. Mathar, Aug 30 2010
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 10:22 EDT 2024. Contains 371967 sequences. (Running on oeis4.)