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.

Showing 1-4 of 4 results.

A004207 a(0) = 1, a(n) = sum of digits of all previous terms.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 23, 28, 38, 49, 62, 70, 77, 91, 101, 103, 107, 115, 122, 127, 137, 148, 161, 169, 185, 199, 218, 229, 242, 250, 257, 271, 281, 292, 305, 313, 320, 325, 335, 346, 359, 376, 392, 406, 416, 427, 440, 448, 464, 478, 497, 517, 530, 538
Offset: 0

Views

Author

Keywords

Comments

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
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
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
There are infinitely many even terms (Belov 2003).
a(n) = A007618(n-5) for n > 57; a(n) = A006507(n-4) for n > 15. - Reinhard Zumkeller, Oct 14 2013

References

  • N. Agronomof, Problem 4421, L'Intermédiaire des mathématiciens, v. 21 (1914), p. 147.
  • D. R. Kaprekar, Puzzles of the Self-Numbers. 311 Devlali Camp, Devlali, India, 1959.
  • D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately printed, 311 Devlali Camp, Devlali, India, 1963.
  • J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 65.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • 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.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 37.

Crossrefs

For the base-2 analog see A010062.
A065075 gives sum of digits of a(n).
See A219675 for an essentially identical sequence.

Programs

  • Haskell
    a004207 n = a004207_list !! n
    a004207_list = 1 : iterate a062028 1
    -- Reinhard Zumkeller, Oct 14 2013, Sep 12 2011
    
  • Maple
    read("transforms") :
    A004207 := proc(n)
        option remember;
        if n = 0 then
            1;
        else
            add( digsum(procname(i)),i=0..n-1) ;
        end if;
    end proc: # R. J. Mathar, Apr 02 2014
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, 1, (t->
         t+add(i, i=convert(t, base, 10)))(a(n-1)))
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Jul 31 2022
  • Mathematica
    f[s_] := Append[s, Plus @@ Flatten[IntegerDigits /@ s]]; Nest[f, {1}, 55] (* Robert G. Wilson v, May 26 2006 *)
    f[n_] := n + Plus @@ IntegerDigits@n; Join[{1}, NestList[f, 1, 80]] (* Alonso del Arte, May 27 2006 *)
  • 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
    
  • PARI
    a = 1; print1(a, ", "); for(i = 1, 50, print1(a, ", "); a = a + sumdigits(a)); \\ Nile Nepenthe Wynar, Feb 10 2018
    
  • Python
    from itertools import islice
    def agen():
        yield 1; an = 1
        while True: yield an; an += sum(map(int, str(an)))
    print(list(islice(agen(), 54))) # Michael S. Branicky, Jul 31 2022

Formula

For n>1, a(n) = a(n-1) + sum of digits of a(n-1).
For n > 1: a(n) = A062028(a(n-1)). - Reinhard Zumkeller, Oct 14 2013

Extensions

Errors from 25th term on corrected by Leonid Broukhis, Mar 15 1996
Typo in definition fixed by Reinhard Zumkeller, Sep 14 2011

A247083 a(n) = 0 for n <= 0: Starting with n=1, a(n) = 1 + the sum of the digital sums of a(0) through a(n-3).

Original entry on oeis.org

0, 1, 1, 1, 2, 3, 4, 6, 9, 13, 19, 28, 32, 42, 52, 57, 63, 70, 82, 91, 98, 108, 118, 135, 144, 154, 163, 172, 182, 192, 202, 213, 225, 229, 235, 244, 257, 267, 277, 291, 306, 322, 334, 343, 350, 360, 370, 378, 387, 397, 415, 433, 452, 462, 472, 483, 495, 508, 523, 541, 554, 564, 574
Offset: 0

Views

Author

Bob Selcoe, Nov 17 2014

Keywords

Examples

			a(10) = 28 because (0+1+1+2+3+5+8+1+3+2+1) + 1 = 28.
		

Crossrefs

Programs

  • Maple
    A247083 := proc(n)
        option remember;
        if n <= 0 then
            0;
        else
            1+add(digsum(procname(i)),i=0..n-3) ;
        end if;
    end proc: # R. J. Mathar, Dec 02 2014
  • Mathematica
    a247083[n_Integer] := Module[{t = Table[1, {i, n + 1}], j, k},
    t[[1]] = 0; j = 5; While[j <= Length[t], t[[j]] = Sum[Plus @@ IntegerDigits[t[[k]]], {k, 1, j - 3}]; j++]; Drop[t, {2}]]; a247083[63] (* Michael De Vlieger, Nov 26 2014 *)
  • PARI
    v=[0];n=1;while(n<100,s=0;for(i=1,#v-2,s+=sumdigits(v[i]));v=concat(v,1+s);n++);v \\ Derek Orr, Nov 26 2014
  • Sage
    n=100
    a=[0,1,1]
    for i in [3..n]:
        a.append(1+sum(sum(a[j].digits()) for j in [1..(i-3)]))
    a # Tom Edgar, Nov 25 2014
    

Formula

a(n) = 1 + Sum_{k=0..n-3} digsum(a(k)).
a(n) = a(n-1) + A007953(a(n-3)).

A247084 a(n)=0 when n<=0: Starting with n=1, a(n) = 1 + the sum of the digital sums of a(0) through a(n-4).

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 3, 4, 5, 7, 10, 14, 19, 26, 27, 32, 42, 50, 59, 64, 70, 75, 89, 99, 106, 118, 135, 153, 160, 170, 179, 188, 195, 203, 220, 237, 252, 257, 261, 273, 282, 296, 305, 317, 329, 346, 354, 365, 379, 392, 404, 418, 437, 451, 459, 472, 486, 496, 514
Offset: 0

Views

Author

Bob Selcoe, Nov 17 2014

Keywords

Examples

			a(15) = 32 because (0+1+1+1+1+2+3+4+5+7+1+0+1+4) + 1 = 32.
		

Crossrefs

Cf. A007953, A219675, A244510 (related).

Programs

  • Mathematica
    a247084[n_Integer] := Module[{t = Table[1, {i, n + 1}], j, k},
    t[[1]] = 0; j = 6; While[j <= Length[t], t[[j]] = Sum[Plus @@ IntegerDigits[t[[k]]], {k, 1, j - 4}]; ++]; Drop[t, {2}]]; a247084[59] (* Michael De Vlieger, Nov 29 2014 *)
  • PARI
    lista(nn) = {v = vector(nn); for (n=2, nn, v[n] = 1 + sum(i=1, n-4, if (n-4 > 0, sumdigits(v[i])));); v;} \\ Michel Marcus, Nov 18 2014

Formula

a(n) = 1 + Sum_{k=0..n-4} digsum(a(k)).
a(n) = a(n-1) + digsum(a(n-4)).

Extensions

More terms from Michel Marcus, Nov 18 2014

A374908 Each term is the sum of the preceding term and its seven-segment total A006942.

Original entry on oeis.org

0, 6, 12, 19, 27, 35, 45, 54, 63, 74, 81, 90, 102, 115, 124, 135, 147, 156, 169, 183, 197, 208, 226, 242, 256, 272, 285, 302, 318, 332, 347, 359, 375, 388, 407, 420, 435, 449, 463, 478, 492, 507, 521, 533, 548, 564, 579, 593, 609, 627, 641, 653, 669, 687, 703
Offset: 0

Views

Author

David J. Ellis, Jul 23 2024

Keywords

Comments

The number of segments in each digit 0 to 9 is [6,2,5,5,4,5,6,3,7,6].
Conjecture: Taking the least significant digit of each term is not an eventually periodic sequence.

Examples

			For n=1, the preceding a(0) = 0 is 6 segments so that a(1) = 0 + 6 = 6.
		

Crossrefs

Programs

  • Mathematica
    s={0};Do[AppendTo[s,Last[s]+ Plus @@ (IntegerDigits@ Last[s] /. {0 -> 6, 1 -> 2, 2 -> 5, 3 -> 5, 7 -> 3, 8 -> 7, 9 -> 6})],{n,54}];s (* James C. McMahon, Aug 19 2024 *)
  • Python
    from itertools import islice
    def b(n): return sum([6, 2, 5, 5, 4, 5, 6, 3, 7, 6][int(d)] for d in str(n))
    def agen(): # generator of terms
        yield (an:=0)
        while True: yield (an:=an+b(an))
    print(list(islice(agen(), 55))) # Michael S. Branicky, Jul 28 2024

Formula

a(n) = a(n-1) + A006942(a(n-1)).
Showing 1-4 of 4 results.