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 19 results. Next

A230289 Let m = n-th number not divisible by 3 (A001651); a(n) = position of m in A065075, or -1 if never appears in A065075.

Original entry on oeis.org

1, 3, 4, 7, 6, 5, 8, 9, 10, 13, 24, 41, 26, 51, 64, 151, 276, 335, 446, 219, 550, 451, 1674, 1685, 2192, 2667, 9220, 17647, 3972, 9221, 17648, 25311, 35776, 25339, 147018, 112397, 146972, 212667, 243892, 243871, 963024, 1263521, 1838078, 2380569, 2380378
Offset: 1

Views

Author

N. J. A. Sloane, Oct 17 2013

Keywords

Comments

It is believed that a(n) is always > 0.

Crossrefs

Programs

  • Maple
    read transforms; M:=100000; sp:=1; a:=[sp]; s:=sp;
    for n from 2 to M do sp:=digsum(s); a:=[op(a),sp]; s:=s+sp; od:
    b:=[]:
    for n from 1 to 100 do
    if (n mod 3) <> 0 then
    if member(n,a,'p') then b:=[op(b),p] else b:=[op(b),-1]; fi;
    fi;
    od:
    b;

Extensions

a(35)-a(45) from Lars Blomberg, Jul 31 2017

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

A001370 Sum of digits of 2^n.

Original entry on oeis.org

1, 2, 4, 8, 7, 5, 10, 11, 13, 8, 7, 14, 19, 20, 22, 26, 25, 14, 19, 29, 31, 26, 25, 41, 37, 29, 40, 35, 43, 41, 37, 47, 58, 62, 61, 59, 64, 56, 67, 71, 61, 50, 46, 56, 58, 62, 70, 68, 73, 65, 76, 80, 79, 77, 82, 92, 85, 80, 70, 77
Offset: 0

Views

Author

Keywords

Comments

Same digital roots as A065075 (sum of digits of the sum of the preceding numbers) and A004207 (sum of digits of all previous terms); they enter into the cycle {1 2 4 8 7 5}. - Alexandre Wajnberg, Dec 11 2005
It is believed that a(n) ~ n*9*log_10(2)/2, but this is an open problem. - N. J. A. Sloane, Apr 21 2013
The Radcliffe preprint shows that a(n) > log_4(n). - M. F. Hasler, May 18 2017
Sierpiński shows that if n >= A137284(k-1) then a(n) >= k (Problem 209). - David Radcliffe, Dec 26 2022

References

  • Archimedeans Problems Drive, Eureka, 26 (1963), 12.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. sum of digits of k^n: A004166 (k=3), A065713 (k=4), A066001(k=5), A066002 (k=6), A066003(k=7), A066004 (k=8), A065999 (k=9), A066005 (k=11), A066006 (k=12).

Programs

  • Haskell
    a001370 = a007953 . a000079  -- Reinhard Zumkeller, Aug 14 2015
  • Maple
    seq(convert(convert(2^n,base,10),`+`),n=0..1000); # Robert Israel, Mar 29 2015
  • Mathematica
    Table[Total[IntegerDigits[2^n]], {n, 0, 55}] (* Vincenzo Librandi, Oct 08 2013 *)
  • PARI
    a(n)=sumdigits(2^n); \\ Michel Marcus, Nov 01 2013
    
  • Python
    [sum(map(int, str(2**n))) for n in range(56)] # David Radcliffe, Mar 29 2015
    

Formula

a(n) = A007953(A000079(n)). - Michel Marcus, Nov 01 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))))
    

A169732 a(1) = 1000; for n>1, a(n) = a(n-1) - digitsum(a(n-1)).

Original entry on oeis.org

1000, 999, 972, 954, 936, 918, 900, 891, 873, 855, 837, 819, 801, 792, 774, 756, 738, 720, 711, 702, 693, 675, 657, 639, 621, 612, 603, 594, 576, 558, 540, 531, 522, 513, 504, 495, 477, 459, 441, 432, 423, 414, 405, 396, 378, 360, 351, 342, 333, 324, 315, 306, 297, 279, 261, 252, 243, 234, 225, 216, 207, 198, 180, 171, 162, 153, 144, 135, 126, 117, 108, 99, 81, 72, 63, 54, 45, 36, 27, 18, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

N. J. A. Sloane, May 01 2010, based on a suggestion from Chris Cole

Keywords

Crossrefs

Programs

  • Maple
    f:=proc(n) global S; option remember; if n=1 then RETURN(S) else RETURN(f(n-1)-digsum(f(n-1))); fi; end; S:=1000; [seq(f(n),n=1..120)];
  • Mathematica
    NestList[#-Total[IntegerDigits[#]]&,1000,100] (* Harvey P. Dale, Mar 28 2020 *)

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

A129888 Start with 10; write down the sum of its digits; add last two terms; repeat.

Original entry on oeis.org

10, 1, 11, 2, 13, 4, 17, 8, 25, 7, 32, 5, 37, 10, 47, 11, 58, 13, 71, 8, 79, 16, 95, 14, 109, 10, 119, 11, 130, 4, 134, 8, 142, 7, 149, 14, 163, 10, 173, 11, 184, 13, 197, 17, 214, 7, 221, 5, 226, 10, 236, 11, 247, 13, 260, 8, 268, 16, 284, 14, 298, 19, 317, 11, 328, 13
Offset: 1

Views

Author

N. J. A. Sloane, May 26 2007

Keywords

Crossrefs

Programs

  • Mathematica
    nxt[n_]:=Module[{t=Total[n]},{t,Total[IntegerDigits[t]]}]; Flatten[ NestList[ nxt,{10,1},35]] (* Harvey P. Dale, Mar 29 2011 *)
  • Python
    def next2(n): sd = sum(map(int, str(n))); return [sd, n+sd]
    def aupton(terms):
        alst = [10]
        while len(alst) < terms: alst.extend(next2(alst[-1]))
        return alst[:terms]
    print(aupton(66)) # Michael S. Branicky, Oct 01 2021

Formula

a(2n+1)=A007618(n+2). For 1<=n<=10: a(2n)=A065075(n+1). - R. J. Mathar, Jun 14 2007

Extensions

More terms from R. J. Mathar, Jun 14 2007

A084229 Let b(1)=1, b(2)=2, b(n) = sum of digits of b(1)+b(2)+b(3)+...+b(n-1), sequence gives values of n such that b(n)=3.

Original entry on oeis.org

3, 5, 7, 9, 17, 19, 27, 29, 87, 95, 97, 159, 591, 599, 601, 663, 1143, 4609, 4617, 4619, 4681, 5161, 8993, 13165, 38277, 38279, 38341, 38821, 42653, 46825, 75043, 79223, 327015, 327023, 327025, 327087, 327567, 331399, 335571, 363789, 367969, 642981, 647153, 2847029, 2847031, 2847093, 2847573
Offset: 1

Views

Author

Benoit Cloitre, Jun 21 2003

Keywords

Comments

The {b(n)} sequence is A084228. - N. J. A. Sloane, Jun 26 2014
Note that b(k)==0 (mod 3) for n>2.

Crossrefs

Programs

  • Mathematica
    k = 3; lst = {}; a = 3; While[k < 100000001, b = a + Total@ IntegerDigits@ a; If[b == a + 3, AppendTo[lst, k]; Print@ k]; a = b; k++]; lst (* Robert G. Wilson v, Jun 27 2014 *)
  • PARI
    upto(n)={my(L=List(), s=3, k=3); while(k<=n, my(t=sumdigits(s)); if(t==3, listput(L,k)); s+=t; k++); Vec(L)} \\ Andrew Howroyd, Oct 16 2024

Formula

Conjecture : a(n)/n^3 is bounded.

Extensions

a(23) onward from Robert G. Wilson v, Jun 27 2014

A112435 Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 4.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 8, 16, 23, 28, 38, 45, 42, 41, 41, 36, 34, 32, 31, 30, 28, 29, 33, 34, 37, 44, 42, 37, 41, 39, 41, 38, 43, 40, 39, 39, 46, 45, 47, 54, 51, 45, 44, 43, 39, 42, 42, 39, 43, 43, 38, 43, 44, 40, 37, 40, 33, 32, 29, 36, 35, 39, 45, 49, 51, 48, 52, 47
Offset: 1

Views

Author

Alexandre Wajnberg, Dec 11 2005

Keywords

Comments

Variation on Angelini's A112395. The sequence cycles at a(16)=38 and the loop has 312 terms. It is exactly the same loop as in A112433 "Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 2" and the first term of this 4-loop is the first term of that 2-loop . Computed by Gilles Sadowski.

Examples

			a(16)=38 because 4 + 4 + 8 + 1+6 +2+3 + 2+8 = 38
		

Crossrefs

Programs

  • Mathematica
    nxt[{t_,a_}]:={Take[Join[t,IntegerDigits[Total[t]]],-10],Total[t]}; Join[ {0,0,0,0,0,0,0,0,0},NestList[nxt,{{0,0,0,0,0,0,0,0,0,4},4},80][[All,2]]] (* Harvey P. Dale, Jun 22 2019 *)

A112437 Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 6.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 12, 15, 21, 24, 30, 21, 21, 18, 24, 24, 27, 33, 36, 36, 39, 45, 45, 48, 51, 48, 48, 51, 48, 48, 54, 51, 45, 48, 48, 48, 51, 51, 48, 48, 48, 48, 54, 57, 57, 57, 57, 57, 60, 54, 51, 45, 42, 36, 39, 42, 42, 39, 45, 45, 42, 42, 42, 36, 36, 36, 39, 45
Offset: 1

Views

Author

Alexandre Wajnberg, Dec 11 2005

Keywords

Comments

Variation on Angelini's A112395. The sequence cycles at a(24)=36 and the loop has 104 terms. It is the same loop as in A112434 "Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 3"; the first term of this 6-loop is the 47th term of that 3-loop and the first term of that 3-loop is the 59th of this 6-loop. Computed by Gilles Sadowski.

Examples

			a(24)=36 because 1+8 + 2+4 + 2+4 + 2+7 + 3+3 = 36
		

Crossrefs

Showing 1-10 of 19 results. Next