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.
%I A004207 M1115 #129 Jul 06 2025 11:07:53 %S A004207 1,1,2,4,8,16,23,28,38,49,62,70,77,91,101,103,107,115,122,127,137,148, %T A004207 161,169,185,199,218,229,242,250,257,271,281,292,305,313,320,325,335, %U A004207 346,359,376,392,406,416,427,440,448,464,478,497,517,530,538 %N A004207 a(0) = 1, a(n) = sum of digits of all previous terms. %C A004207 If the leading 1 is omitted, this is the important sequence b(1)=1, for n >= 2, b(n) = b(n-1) + sum of digits of b(n-1). Cf. A016052, A016096, etc. - _N. J. A. Sloane_, Dec 01 2013 %C A004207 Same digital roots as A065075 (Sum of digits of the sum of the preceding numbers) and A001370 (Sum of digits of 2^n); they end in the cycle {1 2 4 8 7 5}. - _Alexandre Wajnberg_, Dec 11 2005 %C A004207 More precisely, mod 9 this sequence is 1 (1 2 4 8 7 5)*, the parenthesized part being repeated indefinitely. This shows that this sequence is disjoint from A016052. - _N. J. A. Sloane_, Oct 15 2013 %C A004207 There are infinitely many even terms (Belov 2003). %C A004207 a(n) = A007618(n-5) for n > 57; a(n) = A006507(n-4) for n > 15. - _Reinhard Zumkeller_, Oct 14 2013 %D A004207 N. Agronomof, Problem 4421, L'Intermédiaire des mathématiciens, v. 21 (1914), p. 147. %D A004207 D. R. Kaprekar, Puzzles of the Self-Numbers. 311 Devlali Camp, Devlali, India, 1959. %D A004207 D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately printed, 311 Devlali Camp, Devlali, India, 1963. %D A004207 J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 65. %D A004207 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %D A004207 G. E. Stevens and L. G. Hunsberger, A Result and a Conjecture on Digit Sum Sequences, J. Recreational Math. 27, no. 4 (1995), pp. 285-288. %D A004207 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 37. %H A004207 T. D. Noe, <a href="/A004207/b004207.txt">Table of n, a(n) for n = 0..10000</a> %H A004207 A. Ya. Belov (ed.), <a href="https://www.researchgate.net/publication/299629504_Sbornik_zadac-monstrov_po_matematike">Collection of monster problems in mathematics</a> (in Russian), 2003. Problem 39. %H A004207 D. R. Kaprekar, <a href="/A003052/a003052_2.pdf">The Mathematics of the New Self Numbers</a> [annotated and scanned] %H A004207 J. Laroche & N. J. A. Sloane, <a href="/A004207/a004207.pdf">Correspondence, 1977</a> %H A004207 Project Euler, <a href="https://projecteuler.net/problem=551">Problem 551: Sum of digits sequence</a>. %H A004207 Kenneth B. Stolarsky, <a href="http://dx.doi.org/10.1090/S0002-9939-1976-0409340-X">The sum of a digitaddition series</a>, Proc. Amer. Math. Soc. 59 (1976), no. 1, 1--5. MR0409340 (53 #13099) %H A004207 <a href="/index/Coi#Colombian">Index entries for Colombian or self numbers and related sequences</a> %F A004207 For n>1, a(n) = a(n-1) + sum of digits of a(n-1). %F A004207 For n > 1: a(n) = A062028(a(n-1)). - _Reinhard Zumkeller_, Oct 14 2013 %p A004207 read("transforms") : %p A004207 A004207 := proc(n) %p A004207 option remember; %p A004207 if n = 0 then %p A004207 1; %p A004207 else %p A004207 add( digsum(procname(i)),i=0..n-1) ; %p A004207 end if; %p A004207 end proc: # _R. J. Mathar_, Apr 02 2014 %p A004207 # second Maple program: %p A004207 a:= proc(n) option remember; `if`(n<2, 1, (t-> %p A004207 t+add(i, i=convert(t, base, 10)))(a(n-1))) %p A004207 end: %p A004207 seq(a(n), n=0..60); # _Alois P. Heinz_, Jul 31 2022 %t A004207 f[s_] := Append[s, Plus @@ Flatten[IntegerDigits /@ s]]; Nest[f, {1}, 55] (* _Robert G. Wilson v_, May 26 2006 *) %t A004207 f[n_] := n + Plus @@ IntegerDigits@n; Join[{1}, NestList[f, 1, 80]] (* _Alonso del Arte_, May 27 2006 *) %o A004207 (Haskell) %o A004207 a004207 n = a004207_list !! n %o A004207 a004207_list = 1 : iterate a062028 1 %o A004207 -- _Reinhard Zumkeller_, Oct 14 2013, Sep 12 2011 %o A004207 (PARI) a(n) = { my(f(d, i) = d+vecsum(digits(d)), S=vector(n)); S[1]=1; for(k=1, n-1, S[k+1] = fold(f, S[1..k])); S } \\ _Satish Bysany_, Mar 03 2017 %o A004207 (PARI) a = 1; print1(a, ", "); for(i = 1, 50, print1(a, ", "); a = a + sumdigits(a)); \\ _Nile Nepenthe Wynar_, Feb 10 2018 %o A004207 (Python) %o A004207 from itertools import islice %o A004207 def agen(): %o A004207 yield 1; an = 1 %o A004207 while True: yield an; an += sum(map(int, str(an))) %o A004207 print(list(islice(agen(), 54))) # _Michael S. Branicky_, Jul 31 2022 %Y A004207 Cf. A016052, A016096, A033298, A007612, A007953, A229527, A230107. %Y A004207 For the base-2 analog see A010062. %Y A004207 A065075 gives sum of digits of a(n). %Y A004207 See A219675 for an essentially identical sequence. %K A004207 nonn,base,easy,nice %O A004207 0,3 %A A004207 _N. J. A. Sloane_ %E A004207 Errors from 25th term on corrected by _Leonid Broukhis_, Mar 15 1996 %E A004207 Typo in definition fixed by _Reinhard Zumkeller_, Sep 14 2011