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-10 of 24 results. Next

A230286 a(n) = A016052(n)/3.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 11, 13, 17, 19, 23, 28, 32, 37, 38, 40, 41, 43, 47, 49, 53, 58, 62, 67, 68, 70, 71, 73, 77, 79, 83, 88, 92, 97, 101, 103, 107, 109, 113, 118, 122, 127, 131, 136, 140, 142, 146, 151, 155, 160, 164
Offset: 1

Views

Author

Keywords

Comments

a(1) = 1; for n >= 1, a(n+1) = a(n) + sum of its digits.

Crossrefs

Cf. A004207, A016052, A230287 (first differences).

Programs

  • Haskell
    a230286 = (flip div 3) . a016052

A230287 First differences of A016052/3 (= A230286).

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 4, 2, 4, 5, 4, 5, 1, 2, 1, 2, 4, 2, 4, 5, 4, 5, 1, 2, 1, 2, 4, 2, 4, 5, 4, 5, 4, 2, 4, 2, 4, 5, 4, 5, 4, 5, 4, 2, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 7, 5, 4, 5, 4, 5, 7, 8, 4, 5, 4, 5, 7, 8, 4, 5, 7, 5, 7, 5, 4, 5, 7, 8, 7, 2, 1, 2, 4, 2, 4, 5, 4, 5, 1, 2, 1, 2, 4, 2, 4, 5, 4, 5, 4
Offset: 1

Views

Author

Keywords

Comments

This sequence captures the essence of A016052.
Essentially the same as A084228/3.

Crossrefs

Programs

  • Haskell
    a230287 n = a230287_list !! (n-1)
    a230287_list = zipWith (-) (tail a230286_list) a230286_list

A119507 Members of A016052 whose digit sum is three.

Original entry on oeis.org

3, 12, 21, 30, 111, 120, 201, 210, 1020, 1101, 1110, 2010, 10020, 10101, 10110, 11010, 20100, 100020, 100101, 100110, 101010, 110100, 200100, 300000, 1000101, 1000110, 1001010, 1010100, 1100100, 1200000, 2000010, 2100000, 10000020, 10000101
Offset: 1

Views

Author

Zak Seidov and Robert G. Wilson v, May 27 2006

Keywords

Comments

A016052: a(n+1) = a(n) + sum of its digits, a(1) = 3.
Positions of these numbers in A016052: 1, 3, 5, 7, 15, 17, 25, 27, 85, 93, 95, 157, 589, 597, 599, 661, ...,.

Crossrefs

Cf. A016052.

Programs

  • Mathematica
    lst = {}; a = 3; Do[ If[Plus @@ IntegerDigits@a == 3, AppendTo[lst, a]; Print[a]]; a = a + Plus @@ IntegerDigits@a, {n, 10^7}]; lst

Extensions

Edited by Charles R Greathouse IV, Aug 04 2010

A062028 a(n) = n + sum of the digits of n.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 77
Offset: 0

Views

Author

Amarnath Murthy, Jun 02 2001

Keywords

Comments

a(n) = A248110(n,A007953(n)). - Reinhard Zumkeller, Oct 01 2014

Examples

			a(34) = 34 + 3 + 4 = 41, a(40) = 40 + 4 = 44.
		

Crossrefs

Indices of: A047791 (primes), A107743 (composites), A066564 (squares), A084661 (cubes).
Iterations: A004207 (start=1), A016052 (start=3), A007618 (start=5), A006507 (start=7), A016096 (start=9).

Programs

  • Haskell
    a062028 n = a007953 n + n  -- Reinhard Zumkeller, Oct 11 2013
    
  • Maple
    with(numtheory): for n from 1 to 100 do a := convert(n,base,10):
    c := add(a[i],i=1..nops(a)): printf(`%d,`,n+c); od:
    A062028 := n -> n+add(i,i=convert(n,base,10)) # M. F. Hasler, Nov 08 2018
  • Mathematica
    Table[n + Total[IntegerDigits[n]], {n, 0, 100}]
  • PARI
    A062028(n)=n+sumdigits(n) \\ M. F. Hasler, Jul 19 2015
    
  • Python
    def a(n): return n + sum(map(int, str(n)))
    print([a(n) for n in range(71)]) # Michael S. Branicky, Jan 09 2023

Formula

a(n) = n + A007953(n).
a(n) = A160939(n+1) - 1. - Filip Zaludek, Oct 26 2016

Extensions

More terms from Vladeta Jovovic, Jun 05 2001

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

A037123 a(n) = a(n-1) + sum of digits of n.

Original entry on oeis.org

0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 46, 48, 51, 55, 60, 66, 73, 81, 90, 100, 102, 105, 109, 114, 120, 127, 135, 144, 154, 165, 168, 172, 177, 183, 190, 198, 207, 217, 228, 240, 244, 249, 255, 262, 270, 279, 289, 300, 312, 325, 330, 336, 343, 351, 360, 370, 381
Offset: 0

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net), Jun 15 1998

Keywords

Comments

Sum of digits of A007908(n). - Franz Vrabec, Oct 22 2007
Also digital sum of A138793(n) for n > 0. - Bruno Berselli, May 27 2011
Sum of the digital sum of i for i from 0 to n. - N. J. A. Sloane, Nov 13 2013

References

  • N. Agronomof, Sobre una función numérica, Revista Mat. Hispano-Americana 1 (1926), 267-269.
  • Maurice d'Ocagne, Sur certaines sommations arithmétiques, J. Sciencias Mathematicas e Astronomicas 7 (1886), 117-128.

Crossrefs

Cf. also A074784, A231688, A231689.
Partial sums of A007953.

Programs

  • Magma
    [ n eq 0 select 0 else &+[&+Intseq(k): k in [0..n]]: n in [0..56] ];  // Bruno Berselli, May 27 2011
  • Maple
    # From N. J. A. Sloane, Nov 13 2013:
    digsum:=proc(n,B) local a; a := convert(n, base, B):
    add(a[i], i=1..nops(a)): end;
    f:=proc(n,k,B) global digsum; local i;
    add( digsum(i,B)^k,i=0..n); end;
    lprint([seq(digsum(n,10),n=0..100)]); # A007953
    lprint([seq(f(n,1,10),n=0..100)]); #A037123
    lprint([seq(f(n,2,10),n=0..100)]); #A074784
    lprint([seq(f(n,3,10),n=0..100)]); #A231688
    lprint([seq(f(n,4,10),n=0..100)]); #A231689
  • Mathematica
    Table[Plus@@Flatten[IntegerDigits[Range[n]]], {n, 0, 200}] (* Enrique Pérez Herrero, Oct 12 2015 *)
    a[0] = 0; a[n_] := a[n - 1] + Plus @@ IntegerDigits@ n; Array[a, 70, 0] (* Robert G. Wilson v, Jul 06 2018 *)
  • PARI
    a(n)=n*(n+1)/2-9*sum(k=1,n,sum(i=1,ceil(log(k)/log(10)),floor(k/10^i)))
    
  • PARI
    a(n)={n++;my(t,i,s);c=n;while(c!=0,i++;c\=10);for(j=1,i,d=(n\10^(i-j))%10;t+=(10^(i-j)*(s*d+binomial(d,2)+d*9*(i-j)/2));s+=d);t} \\ David A. Corneth, Aug 16 2013
    
  • Perl
    for $i (0..100){ @j = split "", $i; for (@j){ $sum += $; } print "$sum,"; } __END_ # gamo(AT)telecable.es
    

Formula

a(n) = Sum_{k=0..n} s(k) = Sum_{k=0..n} A007953(k), where s(k) denote the sum of the digits of k in decimal representation. Asymptotic expression: a(n-1) = Sum_{k=0..n-1} s(k) = 4.5*n*log_10(n) + O(n). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 07 2002
a(n) = n*(n+1)/2 - 9*Sum_{k=1..n} Sum_{i=1..ceiling(log_10(k))} floor(k/10^i). - Benoit Cloitre, Aug 28 2003
From Hieronymus Fischer, Jul 11 2007: (Start)
G.f.: Sum_{k>=1} ((x^k - x^(k+10^k) - 9x^(10^k))/(1-x^(10^k)))/(1-x)^2.
a(n) = (1/2)*((n+1)*(n - 18*Sum_{k>=1} floor(n/10^k)) + 9*Sum_{k>=1} (1 + floor(n/10^k))*floor(n/10^k)*10^k).
a(n) = (1/2)*((n+1)*(2*A007953(n)-n) + 9*Sum_{k>=1} (1+floor(n/10^k))*floor(n/10^k)*10^k). (End)
a(n) = A007953(A053064(n)). - Reinhard Zumkeller, Oct 10 2008
From Wojciech Raszka, Jun 14 2019: (Start)
a(10^k - 1) = 10*a(10^(k - 1) - 1) + 45*10^(k - 1) for k > 0.
a(n) = a(n mod m) + MSD*a(m - 1) + (MSD*(MSD - 1)/2)*m + MSD*((n mod m) + 1), where m = 10^(A055642(n) - 1), MSD = A000030(n). (End)

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 07 2002

A007618 a(n) = a(n-1) + sum of digits of a(n-1), a(1) = 5.

Original entry on oeis.org

5, 10, 11, 13, 17, 25, 32, 37, 47, 58, 71, 79, 95, 109, 119, 130, 134, 142, 149, 163, 173, 184, 197, 214, 221, 226, 236, 247, 260, 268, 284, 298, 317, 328, 341, 349, 365, 379, 398, 418, 431, 439, 455, 469, 488, 508, 521, 529, 545, 559, 578, 598, 620, 628, 644
Offset: 1

Views

Author

Keywords

Comments

a(n) = A004207(n+5) for n > 52. - Reinhard Zumkeller, Oct 14 2013
a(2) = 10 and a(590) = 10000 are the first two powers of 10 in this sequence; there are no others below a(19017393928) = 1000000000093. Conjecture: the sequence contains infinitely many powers of 10. - Charles R Greathouse IV, Mar 29 2022

References

  • N. Agronomof, Problem 4421, L'Intermédiaire des mathématiciens, v. 21 (1914), p. 147. (Mentions sequence starting at 11.) - N. J. A. Sloane, Nov 22 2013.
  • 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).

Crossrefs

Programs

  • Haskell
    a007618 n = a007618_list !! (n-1)
    a007618_list = iterate a062028 5  -- Reinhard Zumkeller, Oct 14 2013
    
  • Python
    from itertools import accumulate
    def f(an, _): return an + sum(int(d) for d in str(an))
    print(list(accumulate([5]*55, f))) # Michael S. Branicky, May 10 2021

Formula

a(n) = A062028(a(n-1)) for n > 1. - Reinhard Zumkeller, Oct 14 2013

A006507 a(n+1) = a(n) + sum of digits of a(n), with a(1)=7.

Original entry on oeis.org

7, 14, 19, 29, 40, 44, 52, 59, 73, 83, 94, 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, 554, 568
Offset: 1

Views

Author

Keywords

Comments

a(n) = A004207(n+4) for n > 11. - Reinhard Zumkeller, Oct 14 2013

References

  • Editorial Note, Popular Computing (Calabasas, CA), Vol. 4 (No. 37, Apr 1976), p. 12.
  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 36.
  • 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.
  • Jeffrey Shallit, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006507 n = a006507_list !! (n-1)
    a006507_list = iterate a062028 7  -- Reinhard Zumkeller, Oct 14 2013
  • Mathematica
    NestList[#+Total[IntegerDigits[#]]&,7,50] (* Harvey P. Dale, Jan 25 2021 *)

Formula

a(n) = A062028(a(n-1)) for n > 1. - Reinhard Zumkeller, Oct 14 2013

Extensions

More terms from Robert G. Wilson v

A016096 a(n+1) = a(n) + sum of its digits, with a(1) = 9.

Original entry on oeis.org

9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99, 117, 126, 135, 144, 153, 162, 171, 180, 189, 207, 216, 225, 234, 243, 252, 261, 270, 279, 297, 315, 324, 333, 342, 351, 360, 369, 387, 405, 414, 423, 432, 441, 450, 459, 477, 495, 513, 522, 531, 540
Offset: 1

Views

Author

Keywords

References

  • 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.

Crossrefs

Programs

  • Haskell
    a016096 n = a016096_list !! (n-1)
    a016096_list = iterate a062028 9  -- Reinhard Zumkeller, Oct 14 2013
    
  • Python
    from itertools import islice
    def A016096_gen(): # generator of terms
        a = 9
        while True:
            yield a
            a += sum(int(d) for d in str(a))
    A016096_list = list(islice(A016096_gen(),20)) # Chai Wah Wu, Mar 29 2022

Formula

a(n) = A062028(a(n-1)) for n > 1. - Reinhard Zumkeller, Oct 14 2013

A084228 a(1)=1, a(2)=2; thereafter a(n) = sum of digits of (a(1)+a(2)+a(3)+...+a(n-1)).

Original entry on oeis.org

1, 2, 3, 6, 3, 6, 3, 6, 3, 6, 12, 6, 12, 15, 12, 15, 3, 6, 3, 6, 12, 6, 12, 15, 12, 15, 3, 6, 3, 6, 12, 6, 12, 15, 12, 15, 12, 6, 12, 6, 12, 15, 12, 15, 12, 15, 12, 6, 12, 15, 12, 15, 12, 15, 12, 15, 12, 15, 12, 15, 21, 15, 12, 15, 12, 15, 21, 24, 12, 15, 12, 15, 21, 24, 12, 15, 21, 15
Offset: 1

Views

Author

Benoit Cloitre, Jun 21 2003

Keywords

Comments

a(n) == 3 or 6 (mod 9) n>2.
a(n) = 3 for n in A084229.
a(n) = 6 for n = 4, 6, 8, 10, 12, 18, 20, 22, 28, 30, 32, 38, 40, 48, 86, 88, 90, 96, 98, 100, 106, 108, 116, 160, 162, 168, 170, 178, ..., 17630. - Robert G. Wilson v, Jun 27 2014

Crossrefs

Programs

  • Haskell
    a084228 n = a084228_list !! (n-1)
    a084228_list = 1 : 2 : f 3 where
       f x = y : f (x + y) where y = a007953 x
    -- Reinhard Zumkeller, Nov 13 2014
  • Mathematica
    a[1] = 1; a[2] = 2; a[n_] := a[n] = Sum[ Total@ IntegerDigits@ a@ i, {i, n - 1}]; Array[ Total@ IntegerDigits@ a@# &, 78] (* Robert G. Wilson v, Jun 27 2014 *)
    nxt[{t_,a_}]:=Module[{c=Total[IntegerDigits[t]]},{t+c,c}]; Join[{1},NestList[nxt,{3,2},80][[;;,2]]] (* Harvey P. Dale, Jul 13 2023 *)
  • PARI
    sumdig(n)=sum(k=0,ceil(log(n)/log(10)),floor(n/10^k)%10)
    an=vector(10000); a(n)=if(n<0,0,an[n])
    an[1]=1; an[2]=2; for(n=3,300,an[n]=sumdig(sum(k=1,n-1,a(k))))
    
Showing 1-10 of 24 results. Next