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

A352375 Sum of digits of A007618.

Original entry on oeis.org

5, 1, 2, 4, 8, 7, 5, 10, 11, 13, 8, 16, 14, 10, 11, 4, 8, 7, 14, 10, 11, 13, 17, 7, 5, 10, 11, 13, 8, 16, 14, 19, 11, 13, 8, 16, 14, 19, 20, 13, 8, 16, 14, 19, 20, 13, 8, 16, 14, 19, 20, 22, 8, 16, 14, 19, 20, 22, 17, 16, 14, 19, 20, 13, 17, 16, 14, 19, 20, 13
Offset: 1

Views

Author

Mateusz Pasternak, Mar 14 2022

Keywords

References

  • D. R. Kaprekar, Puzzles of the Self-Numbers. 311 Devlali Camp, Devlali, India, 1959.

Crossrefs

Programs

  • PARI
    lista(nn) = my(s, x=5); for(n=1, nn, print1(s=sumdigits(x), ", "); x+=s); \\ Jinyuan Wang, Mar 22 2022
    
  • Python
    from itertools import islice
    def A352375_gen(): # generator of terms
        a = 5
        while True:
            yield (s := sum(int(d) for d in str(a)))
            a += s
    A352375_list = list(islice(A352375_gen(),20)) # Chai Wah Wu, Mar 29 2022

Formula

a(n) = A007953(A007618(n)).
a(n) = A007618(n+1)-A007618(n). - Chai Wah Wu, Mar 29 2022

Extensions

More terms from Jinyuan Wang, Mar 22 2022

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

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

Original entry on oeis.org

3, 6, 12, 15, 21, 24, 30, 33, 39, 51, 57, 69, 84, 96, 111, 114, 120, 123, 129, 141, 147, 159, 174, 186, 201, 204, 210, 213, 219, 231, 237, 249, 264, 276, 291, 303, 309, 321, 327, 339, 354, 366, 381, 393, 408, 420, 426, 438, 453, 465, 480, 492
Offset: 1

Views

Author

Keywords

Comments

Mod 9 this sequence is 3, 6, 3, 6, 3, 6, ... This shows that this sequence is disjoint from A004207. - N. J. A. Sloane, Oct 15 2013

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.
  • 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, pages 34-35.

Crossrefs

Programs

  • Haskell
    a016052 n = a016052_list !! (n-1)
    a016052_list = iterate a062028 3  -- Reinhard Zumkeller, Oct 14 2013
    
  • Mathematica
    NestList[# + Total[IntegerDigits[#]] &, 3, 51] (* Jayanta Basu, Aug 11 2013 *)
    a[1] = 3; a[n_] := a[n] = a[n - 1] + Total@ IntegerDigits@ a[n - 1]; Array[a, 80] (* Robert G. Wilson v, Jun 27 2014 *)
  • PARI
    a_list(nn) = { my(f(n, i) = n + vecsum(digits(n)), S=vector(nn+1)); S[1]=3; for(k=2, #S, S[k] = fold(f, S[1..k-1])); S[2..#S] } \\ Satish Bysany, Mar 04 2017
    
  • Python
    from itertools import islice
    def A016052_gen(): # generator of terms
        yield (a:=3)
        while True: yield (a:=a+sum(map(int,str(a))))
    A016052_list = list(islice(A016052_gen(),20)) # Chai Wah Wu, Jun 16 2024

Formula

a(n) = A062028(a(n-1)) for n > 1. - Reinhard Zumkeller, Oct 14 2013
a(n) - a(n-1) = A084228(n+1). - Robert G. Wilson v, Jun 27 2014

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

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 *)

A230107 Define a sequence by b(1)=n, b(k+1)=b(k)+(sum of digits of b(k)); a(n) is the number of steps needed to reach a term in A004207, or a(n) = -1 if the sequence never joins A004207.

Original entry on oeis.org

0, 0, -1, 0, 52, -1, 11, 0, -1, 51, 50, -1, 49, 10, -1, 0, 48, -1, 9, 50, -1, 49, 0, -1, 47, 48, -1, 0, 8, -1, 49, 46, -1, 47, 48, -1, 45, 0, -1, 7, 46, -1, 47, 6, -1, 45, 44, -1, 0, 46, -1, 5, 5, -1, 45, 44, -1, 43, 4, -1, 4, 0, -1, 4, 44, -1, 43, 3, -1, 0
Offset: 0

Views

Author

N. J. A. Sloane and Reinhard Zumkeller, Oct 15 2013; corrected Oct 20 2013

Keywords

Comments

Looking at b(k) mod 9 shows that a(n) = -1 whenever n is a multiple of 3 (since then the b sequence is disjoint from A004207).
Conjecture: the b sequence, for any starting value n, will eventually merge with one of A000004 (the zero sequence), A004207, A016052 or A016096.

Examples

			For n=3, A016052 never meets A004207, so a(3) = -1.
For n=5, A007618 meets A004207 at the 53rd term, 620, so a(5) = 53.
		

Crossrefs

Programs

  • Haskell
    import Data.Maybe (fromMaybe)
    a230107 = fromMaybe (-1) . f (10^5) 1 1 1 where
       f k i u j v | k <= 0    = Nothing
                   | u < v     = f (k - 1) (i + 1) (a062028 u) j v
                   | u > v     = f (k - 1) i u (j + 1) (a062028 v)
                   | otherwise = Just j
  • Maple
    read transforms; # to get digsum
    M:=2000;
    # f(s) returns the sequence k->k+digsum(k) starting at s
    f:=proc(s) global M; option remember; local n,k,s1;
    s1:=[s]; k:=s;
    for n from 1 to M do  k:=k+digsum(k);
    s1:=[op(s1),k]; od: end;
    # g(s) returns (x,p), where x = first number in common between
    # f(1) and f(s), and p is the position where it occurred.
    # If f(1), f(s) are disjoint for M terms, returns (-1,-1)
    S1:=convert(f(1),set):
    g:=proc(s) global f,S1; local t1,p,S2,S3;
    S2:=convert(f(s),set);
    S3:= S1 intersect S2;
    t1:=min(S3);
    if (t1 = infinity) then RETURN(-1,-1); else
      member(t1,f(s),'p'); RETURN(t1,p-1); fi;
    end;
    [seq(g(n)[2],n=1..20)];

A036228 a(1) = 31; a(n+1) = a(n) + sum of decimal digits of a(n).

Original entry on oeis.org

31, 35, 43, 50, 55, 65, 76, 89, 106, 113, 118, 128, 139, 152, 160, 167, 181, 191, 202, 206, 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, 658
Offset: 1

Views

Author

Miklos SZABO (mike(AT)ludens.elte.hu)

Keywords

Comments

Elements >= 214 can be found in A007618

References

  • D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately Printed, 311 Devlali Camp, Devlali, India, 1963.

Crossrefs

Programs

  • Mathematica
    NestList[#+Total[IntegerDigits[#]]&,31,60] (* Harvey P. Dale, Jan 30 2020 *)

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010

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
Showing 1-10 of 22 results. Next