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.

Previous Showing 31-40 of 118 results. Next

A000221 Take sum of squares of digits of previous term; start with 5.

Original entry on oeis.org

5, 25, 29, 85, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145
Offset: 1

Views

Author

Keywords

Comments

Essentially the same as A080709, cf. formula. - M. F. Hasler, May 24 2009
As the orbit of 5 under A003132, this could as well start with index 0. - M. F. Hasler, Apr 27 2018

References

  • R. Honsberger, Ingenuity in Mathematics, Random House, 1970, p. 83.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 25.

Crossrefs

Cf. A003132 (the iterated map), A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A000218 (starting with 3), A080709 (starting with 4), A008460 (starting with 6), A008462 (starting with 8), A008463 (starting with 9), A139566 (starting with 15), A122065 (starting with 74169). - M. F. Hasler, May 24 2009

Programs

  • Haskell
    a000221 n = a000221_list !! (n-1)
    a000221_list = iterate a003132 5
    -- Reinhard Zumkeller, Mar 04 2013
  • Magma
    [5, 25, 29, 85] cat &cat[[89, 145, 42, 20, 4, 16, 37, 58]: n in [0..17]]; // Vincenzo Librandi, Jan 29 2013
    
  • Mathematica
    NestList[Plus @@ IntegerDigits[ # ]^2 &, 5, 50]
    PadRight[{5,25,29,85},120,{4,16,37,58,89,145,42,20}] (* Harvey P. Dale, Jan 14 2022 *)
  • PARI
    A000221(n)=[20,4,16,37,58,89,145,42,5,25,29,85][n%8+8^(n<5)] \\ M. F. Hasler, May 24 2009, edited Apr 27 2018
    

Formula

Ultimately periodic with period 8.
a(n) = A080709(n) for n >= 5. - M. F. Hasler, May 24 2009
a(n+1) = A003132(a(n)). - Reinhard Zumkeller, Dec 19 2011

A008460 Take sum of squares of digits of previous term; start with 6.

Original entry on oeis.org

6, 36, 45, 41, 17, 50, 25, 29, 85, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4
Offset: 1

Views

Author

Keywords

References

  • R. Honsberger, Ingenuity in Mathematics, Random House, 1970, p. 83.

Crossrefs

Cf. A003132 (the iterated map), A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A000218 (starting with 3), A080709 (starting with 4), A000221 (starting with 5), A008462 (starting with 8), A008463 (starting with 9), A139566 (starting with 15), A122065 (starting with 74169). - M. F. Hasler, May 24 2009

Programs

  • Magma
    [6, 36, 45, 41, 17, 50, 25, 29, 85] cat &cat[[89, 145, 42, 20, 4, 16, 37, 58]: n in [0..17]]; // Vincenzo Librandi, Jan 29 2013
  • Mathematica
    NestList[Total[IntegerDigits[#]^2]&, 6, 80] (* Vincenzo Librandi, Jan 29 2013 *)
  • PARI
    A008460(n)=[6,36,45,41,17, 50,25,29,85,89, 145,42,20,4,16, 37,58][if(n<18,n,(n-10)%8+10)] \\ M. F. Hasler, May 24 2009
    

Formula

Periodic with period 8.
a(13+n) = A080709(n). - M. F. Hasler, May 24 2009

Extensions

An erroneous (duplicate) term deleted by M. F. Hasler, May 24 2009

A008462 Take sum of squares of digits of previous term; start with 8.

Original entry on oeis.org

8, 64, 52, 29, 85, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145
Offset: 1

Views

Author

Keywords

References

  • R. Honsberger, Ingenuity in Math., Random House, 1970, p. 83.

Crossrefs

Cf. A003132 (the iterated map), A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A000218 (starting with 3), A080709 (starting with 4), A000221 (starting with 5), A008460 (starting with 6), A008463 (starting with 9), A139566 (starting with 15), A122065 (starting with 74169). - M. F. Hasler, May 24 2009

Programs

  • Magma
    [8, 64, 52, 29, 85] cat &cat[[89, 145, 42, 20, 4, 16, 37, 58]: n in [0..17]]; // Vincenzo Librandi, Jan 29 2013
    
  • Mathematica
    NestList[Total[IntegerDigits[#]^2]&, 8, 80] (* Vincenzo Librandi, Jan 29 2013 *)
    PadRight[{8,64,52,29,85},80,{20,4,16,37,58,89,145,42}] (* Harvey P. Dale, Dec 27 2019 *)
  • PARI
    A008462(n)=[8, 64, 52, 29, 85, 89, 145, 42, 20, 4, 16, 37, 58][if(n>13,(n-6)%8+6,n)] \\ M. F. Hasler, May 24 2009
    
  • PARI
    Vec(x*(8 + 64*x + 52*x^2 + 29*x^3 + 85*x^4 + 89*x^5 + 145*x^6 + 42*x^7 + 12*x^8 - 60*x^9 - 36*x^10 + 8*x^11 - 27*x^12) / ((1 - x)*(1 + x)*(1 + x^2)*(1 + x^4)) + O(x^60)) \\ Colin Barker, Apr 28 2018

Formula

Periodic with period 8.
a(n) = A080709(n-1) for n >= 5 and a(n) = A000221(n-1) = A008460(n+4) for all n >= 4. - M. F. Hasler, May 24 2009; edited and extended Apr 27 2018
From Colin Barker, Apr 28 2018: (Start)
G.f.: x*(8 + 64*x + 52*x^2 + 29*x^3 + 85*x^4 + 89*x^5 + 145*x^6 + 42*x^7 + 12*x^8 - 60*x^9 - 36*x^10 + 8*x^11 - 27*x^12) / ((1 - x)*(1 + x)*(1 + x^2)*(1 + x^4)).
a(n) = a(n-8) for n>13.
(End)

A080709 Take sum of squares of digits of previous term, starting with 4.

Original entry on oeis.org

4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37
Offset: 1

Views

Author

N. J. A. Sloane, Mar 04 2003

Keywords

Comments

Occurs as puzzle in the Nintendo DS game "Professor Layton and the Diabolical Box". - M. F. Hasler, Dec 18 2009
From M. F. Hasler, Apr 27 2018: (Start)
As the orbit of 4 under A003132, this could rather have offset 0. Merges with the orbit of 5 at the 5th term of both sequences, and with other orbits as given in the formula section.
Porges gave his "set of eight numbers" as a(1)..a(8) in this order, rather than that of the set A039943. (End)

References

  • R. Honsberger, Ingenuity in Math., Random House, 1970, p. 83.

Crossrefs

Cf. A003132 (the iterated map), A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A000218 (starting with 3), A000221 (starting with 5), A008460 (starting with 6), A008462 (starting with 8), A008463 (starting with 9), A139566 (starting with 15), A122065 (starting with 74169). - M. F. Hasler, May 24 2009

Programs

  • Haskell
    a080709 n = a080709_list !! (n-1)
    a080709_list = iterate a003132 4
    -- Reinhard Zumkeller, Aug 24 2011
    
  • Magma
    &cat[[4, 16, 37, 58, 89, 145, 42, 20]: n in [0..17]]; // Vincenzo Librandi, Jan 29 2013
  • Mathematica
    NestList[Total[IntegerDigits[#]^2]&, 4, 80] (* Vincenzo Librandi, Jan 29 2013 *)
  • PARI
    A080709(n)=[4, 16, 37, 58, 89, 145, 42, 20][(n-1)%8+1] \\ M. F. Hasler, May 24 2009
    

Formula

Periodic with period 8.
a(n) = A000216(n+1). - R. J. Mathar, Sep 19 2008
By definition, a(n+1) = A003132(a(n)) for n >= 1. a(n) = A000221(n) = A000218(n+3) = A008460(n+6) = A008462(n+1) = A008463(n+2) = A122065(n+3) = A139566(n+2) for n >= 8 or earlier. - M. F. Hasler, May 24 2009, edited Apr 27 2018

A122065 Take sum of squares of digits of previous term; start with 74169.

Original entry on oeis.org

74169, 183, 74, 65, 61, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4
Offset: 1

Views

Author

Herman Jamke (hermanjamke(AT)fastmail.fm), Sep 14 2006

Keywords

Comments

From a quiz, cf. Russel & Carter reference.

References

  • K. Russell and P. Carter, Number Puzzles, W. Foulsham and Co. Ltd. (1993).

Crossrefs

Cf. A000216 (main entry for related sequences), A003132 (the iterated "sum digits squared" map).

Programs

  • Magma
    [74169, 183, 74, 65, 61] cat &cat[[37, 58, 89, 145, 42, 20, 4, 16]: n in [0..17]]; // Vincenzo Librandi, Jan 29 2013
    
  • Mathematica
    NestList[Total[IntegerDigits[#]^2]&, 74169, 80] (* Vincenzo Librandi, Jan 29 2013 *)
  • PARI
    A122065_vec=vector(50,n,t=if(n>1,norml2(digits(t)),74169));
    A122065(n)=A122065_vec[n%8+(n>7)*8] \\ M. F. Hasler, Apr 27 2018

Formula

a(n) = A000218(n) for n >= 4, a(n) = A000216(n-2) for n >= 6. - M. F. Hasler, Apr 27 2018

A003621 Number of iterations until n reaches 1 or 4 under x goes to sum of squares of digits map.

Original entry on oeis.org

0, 1, 11, 0, 8, 13, 5, 9, 10, 1, 2, 9, 2, 10, 10, 7, 9, 9, 4, 1, 9, 10, 3, 2, 7, 9, 10, 3, 6, 11, 2, 3, 10, 8, 9, 12, 6, 7, 11, 8, 10, 2, 8, 4, 11, 8, 9, 10, 4, 8, 10, 7, 9, 11, 9, 8, 10, 5, 8, 13, 7, 9, 12, 8, 8, 11, 6, 2, 12, 5, 9, 10, 6, 9, 10, 6, 5, 4, 3, 9
Offset: 1

Views

Author

Keywords

References

  • J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 13.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000216, A000218, A300081, etc.
Cf. A003132.

Programs

  • Maple
    f:= n -> convert(map(t -> t^2, convert(n,base,10)),`+`):
    g:= proc(n) option remember;
      if n = 1 or n = 4 then 0 else 1 + procname(f(n)) fi
    end proc:
    map(g, [$1..100]); # Robert Israel, Apr 11 2019
  • Mathematica
    Table[Length[NestWhileList[Total[IntegerDigits[#]^2]&,n,#!=1&&#!=4&]],{n,80}]-1 (* Harvey P. Dale, Dec 31 2016 *)

Formula

a(n) = 0 if n = 1 or 4, otherwise a(n) = 1 + a(A003132(n)). - Robert Israel, Apr 11 2019

A076314 a(n) = floor(n/10) + (n mod 10).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 06 2002

Keywords

Comments

For n<100 this is equal to the digital sum of n (see A007953). - Hieronymus Fischer, Jun 17 2007

Examples

			a(15) = floor(15 / 10) + (15 mod 10) = 1 + 5 = 6. - _Indranil Ghosh_, Feb 13 2017
		

Crossrefs

Programs

Formula

From Hieronymus Fischer, Jun 17 2007: (Start)
a(n) = n - 9*floor(n/10).
a(n) = (n + 9*(n mod 10))/10.
a(n) = n - 9*A002266(A004526(n)) = n - 9*A004526(A002266(n)).
a(n) = (n + 9*A010879(n))/10.
a(n) = (n + 9*A000035(n) + 18*A010874(A004526(n)))/10.
a(n) = (n + 9*A010874(n) + 45*A000035(A002266(n)))/10.
G.f.: x*(8*x^10 - 9*x^9 + 1)/((1 - x^10)*(1 - x)^2). (End)
a(n) = A033930(n) for 1 <= n < 100. - R. J. Mathar, Sep 21 2008
a(n) = +a(n-1) + a(n-10) - a(n-11). - R. J. Mathar, Feb 20 2011

A139566 a(n) is the sum of squares of digits of a(n-1); a(1)=15.

Original entry on oeis.org

15, 26, 40, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37
Offset: 1

Views

Author

Robert Gornall (rob(AT)khobbits.net), Jun 11 2008

Keywords

Crossrefs

Cf. A003132 (the iterated map), A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A000218 (starting with 3), A080709 (starting with 4), A000221 (starting with 5), A008460 (starting with 6), A008462 (starting with 8), A008463 (starting with 9), A122065 (starting with 74169). - M. F. Hasler, May 24 2009

Programs

  • Mathematica
    a = {15}; Do[AppendTo[a, Plus @@ (IntegerDigits[a[[ -1]]]^2)], {70}]; a (* Stefan Steinerberger, Jun 14 2008 *)
    NestList[Total[IntegerDigits[#]^2] &, 15, 70] (* or *) PadRight[ {15,26,40},70,{42,20,4,16,37,58,89,145}](* Harvey P. Dale, Jan 28 2013 *)
  • PARI
    /* to check the given terms */
    a=[/* paste the terms here */]; a==vector(#a,n,k=if(n>1,A003132(k),15))
    /* to check the following code, use: a==vector(99,n,A139566(n)) */
    A139566(n)=[15,26,40,16,37,58,89,145,42,20,4][if(n>11,(n-4)%8+4,n)] \\ (End)
    
  • PARI
    Vec(x*(36*x^10+6*x^9-27*x^8-145*x^7-89*x^6-58*x^5-37*x^4-16*x^3 -40*x^2-26*x-15)/((x-1)*(x+1)*(x^2+1)*(x^4+1)) + O(x^70)) \\ Colin Barker, Aug 24 2015

Formula

Eventually periodic with period 8.
a(n) = A008463(n) for n > 4. - M. F. Hasler, May 24 2009
a(n) = a(n-8) for n > 11. - Colin Barker, Aug 24 2015
G.f.: x*(36*x^10 + 6*x^9 - 27*x^8 - 145*x^7 - 89*x^6 - 58*x^5 - 37*x^4 - 16*x^3 - 40*x^2 - 26*x - 15) / ((x-1)*(x+1)*(x^2+1)*(x^4+1)). - Colin Barker, Aug 24 2015

Extensions

More terms from Stefan Steinerberger, Jun 14 2008
Terms checked, using the given PARI code, by M. F. Hasler, May 24 2009
Minor edits and starting value added in name by M. F. Hasler, Apr 27 2018

A008463 Take sum of squares of digits of previous term; start with 9.

Original entry on oeis.org

9, 81, 65, 61, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145
Offset: 1

Views

Author

Keywords

References

  • R. Honsberger, Ingenuity in Mathematics, Random House, 1970, p. 83.

Crossrefs

Cf. A003132 (the iterated map), A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A000218 (starting with 3), A080709 (starting with 4), A000221 (starting with 5), A008460 (starting with 6), A008462 (starting with 8), A008463 (starting with 9), A139566 (starting with 15), A122065 (starting with 74169). - M. F. Hasler, May 24 2009

Programs

  • Mathematica
    Nest[Append[#, Total[IntegerDigits[Last@ #]^2]] &, {9}, 79] (* Michael De Vlieger, Apr 29 2018 *)
    NestList[Total[IntegerDigits[#]^2]&,9,80] (* or *) PadRight[ {9,81,65,61},80,{42,20,4,16,37,58,89,145}] (* Harvey P. Dale, Sep 11 2019 *)
  • PARI
    A008463(n)=[9,81,65,61,37, 58,89,145,42,20,4,16][if(n>12,(n-5)%8+5,n)]
    /* This code has been checked as follows: */
    k=3;vector(99,n,k=A003132(k))==vector(99,n,A008463(n))
    /* The given terms have been checked as follows: */
    a=[/* paste the terms here */]; apply(A008463,[1..#a])==a \\ (End)

Formula

Periodic with period 8.
a(n) = A000218(n+1). - R. J. Mathar, May 24 2008
a(n) = A080709(n-2) for n > 4. - M. F. Hasler, May 24 2009

A034087 Numbers divisible by the sum of the squares of their digits.

Original entry on oeis.org

1, 10, 20, 50, 100, 110, 111, 120, 130, 133, 200, 210, 240, 267, 298, 310, 315, 360, 372, 376, 400, 420, 480, 500, 532, 550, 630, 803, 917, 973, 1000, 1010, 1011, 1020, 1030, 1071, 1100, 1101, 1110, 1134, 1148, 1200, 1211, 1222, 1290, 1300, 1302, 1316
Offset: 1

Views

Author

Keywords

Examples

			a(100) = 4131 since 4^2+1^2+3^2+1^2=27 divides 4131. - _Carmine Suriano_, May 04 2013
		

Crossrefs

Programs

  • Maple
    isA034087 := proc(n) if n mod A003132(n) = 0 then true ; else false ; end if ; end proc:
    for n from 1 to 1800 do if isA034087(n) then printf("%d ",n) ; end if ; end do ; # R. J. Mathar, Feb 25 2007
  • Mathematica
    Select[Range[1500], Divisible[#, Plus @@ (IntegerDigits[#]^2)] &] (* Amiram Eldar, Jan 31 2021 *)
  • PARI
    isok(m) = !(m % norml2(digits(m))); \\ Michel Marcus, Jan 31 2021
    
  • Python
    def ok(n): return n and n%sum(di**2 for di in map(int, str(n))) == 0
    print([k for k in range(1317) if ok(k)]) # Michael S. Branicky, Jan 10 2025

Formula

A003132[a(n)] | a(n). - R. J. Mathar, Feb 25 2007
Previous Showing 31-40 of 118 results. Next