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.

A161561 The smallest number larger than n with digital sum equal to n.

This page as a plain text file.
%I A161561 #9 Oct 24 2020 12:21:46
%S A161561 10,11,12,13,14,15,16,17,18,19,29,39,49,59,69,79,89,99,199,299,399,
%T A161561 499,599,699,799,899,999,1999,2999,3999,4999,5999,6999,7999,8999,9999,
%U A161561 19999,29999,39999,49999,59999,69999,79999,89999,99999,199999,299999,399999
%N A161561 The smallest number larger than n with digital sum equal to n.
%F A161561 a(n) = min{k>n: A007953(k) = n}.
%e A161561 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.
%t A161561 dsn[n_]:=Module[{k=n+1},While[Total[IntegerDigits[k]]!=n,k++];k]; Array[ dsn,50] (* _Harvey P. Dale_, Oct 24 2020 *)
%o A161561 (PARI) a(n) = my(m = n+1); while(sumdigits(m) != n, m++); m; \\ _Michel Marcus_, Jun 08 2014
%Y A161561 Cf. A161551, A075360, A054750.
%K A161561 base,easy,nonn
%O A161561 1,1
%A A161561 _Enoch Haga_, Jun 13 2009
%E A161561 More precise definition from _R. J. Mathar_, Aug 30 2010