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 11-15 of 15 results.

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

A171250 Row lengths of A082381: number of iterations of "sum of digits squared" until 1 or 4 is reached.

Original entry on oeis.org

1, 1, 11, 1, 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, 9, 3, 7, 10, 5, 2, 4, 14, 4, 10, 4, 6, 11, 4, 8, 12, 3, 4, 12, 1
Offset: 1

Views

Author

M. F. Hasler, Dec 18 2009

Keywords

Comments

In the spirit of A082381, the map A003132 ("sum of digits squared") is applied at least once to the initial value n; the sequence gives the number of iterations until 1 or 4 is reached.

Crossrefs

Cf. A082381, A003132, A082382, A000216 (n=2), A000218 (n=3), A080709 (n=4), A000221 (n=5), A008460 (n=6), A008461 (n=7: ends in 1), A008462 (n=8), A008462 (n=9), A139566 (n=15), A122065 (n=74169), A000012 (n=1).

Programs

  • Mathematica
    Table[Length[NestWhileList[Total[IntegerDigits[#]^2]&,n,!MemberQ[{1,4},#]&]]-1,{n,100}]/.(0->1) (* Harvey P. Dale, Jun 08 2017 *)
  • PARI
    A171250(n)=my(c=0); until( n==4 || n==1, c++; n=norml2(eval(Vec(Str(n))))); c

Formula

a(n) = O(log* n).

Extensions

Formula from Charles R Greathouse IV, Aug 02 2010
Corrected and extended by Harvey P. Dale, Jun 08 2017

A082381 Sequence of the squared digital root of a number until 1 or 4 is reached. The initial numbers 1,2,..n are not output.

Original entry on oeis.org

1, 4, 9, 81, 65, 61, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4, 25, 29, 85, 89, 145, 42, 20, 4, 36, 45, 41, 17, 50, 25, 29, 85, 89, 145, 42, 20, 4, 49, 97, 130, 10, 1, 64, 52, 29, 85, 89, 145, 42, 20, 4, 81, 65, 61, 37, 58, 89, 145, 42, 20, 4, 1, 2, 4, 5, 25, 29
Offset: 1

Views

Author

Cino Hilliard, Apr 13 2003

Keywords

Comments

Conjecture: The sequence always terminates with 1 or the 4 16 37 58 89 145 42 20 4... loop (cf. A080709).
From M. F. Hasler, Dec 18 2009: (Start)
This sequence should be read as fuzzy table, where the n-th row contains the successive results under the map "sum of digits squared", when starting with n, until either 1 or 4 is reached. So either of these two marks the end of a row: See example.
Row lengths (i.e. "stopping times") are given in A171250. (End)

Examples

			From _M. F. Hasler_, Dec 18 2009: (Start)
The table reads:
[n=1] 1 (n=1 -> 1^2=1 -> STOP)
[n=2] 4 (n=2 -> 2^2=4 -> STOP)
[n=3] 9,81,65,61,37,58,89,145,42,20,4 (n=3 -> 3^2=9 -> 9^2=81 -> 8^2+1^2=65 -> ...)
[n=4] 16,37,58,89,145,42,20,4 (n=4 -> 4^2=16 -> 1^2+6^2=37 -> 3^2+7^2=58 -> ...)
...
[n=7] 49,97,130,10,1 (n=7 -> 7^2=49 -> 4^2+9^2=97 -> 130 -> 10 -> 1 -> STOP)
etc. (End)
		

References

  • C. Stanley Ogilvy, Tomorrow's Math, 1972

Crossrefs

Cf. A082382 (list also the initial value); sequences ending in the 4-loop: A000216 (n=2), A000218 (n=3), A080709 (n=4), A000221 (n=5), A008460 (n=6), A008462 (n=8), A008462 (n=9), A139566 (n=15), A122065 (n=74169); sequences ending in 1: A000012 (n=1), A008461 (n=7). [From M. F. Hasler, Dec 18 2009]

Programs

  • PARI
    digitsq2(m) = {y=0; for(x=1,m, digitsq(x) ) }
    /* The squared digital root of a number */ digitsq(n) = { while(1, s=0; while(n > 0, d=n%10; s = s+d*d; n=floor(n/10); ); print1(s" "); if(s==1 || s==4,break); n=s; ) }

Extensions

Corrected and edited, added explanations M. F. Hasler, Dec 18 2009

A250202 The "sum of squares of digits" problem in base 12, start with 6 (written in base 10).

Original entry on oeis.org

6, 36, 9, 81, 117, 162, 38, 13, 2, 4, 16, 17, 26, 8, 64, 41, 34, 104, 128, 164, 66, 61, 26, 8, 64, 41, 34, 104, 128, 164, 66, 61, 26, 8, 64, 41, 34, 104, 128, 164, 66, 61, 26, 8, 64, 41, 34, 104, 128, 164, 66, 61, 26, 8, 64, 41, 34, 104, 128, 164, 66, 61, 26, 8, 64, 41
Offset: 1

Views

Author

Eric Chen, Mar 13 2015

Keywords

Comments

Periodic with period 10.
In base 12, there are 3 fixed points and 4 cycles (only 1 fixed point and 1 cycle in base 10, see A161772):
1 -> 1 (length 1);
5 -> 21 -> 5 (length 2);
8 -> 54 -> 35 -> 2a -> 88 -> a8 -> 118 -> 56 -> 51 -> 22 -> 8 (length 10);
18 -> 55 -> 42 -> 18 (length 3);
25 -> 25 (length 1);
68 -> 84 -> 68 (length 2);
a5 -> a5 (length 1);
Notice 25 (decimal 29) and a5 (decimal 125) are Armstrong numbers in base 12 (A161949), there are no 2-digit Armstrong numbers in base 10.
In base 12, there are only few happy numbers (no such between 10 (decimal 12) and 100 (decimal 144)), but in base 10, there are 20 happy numbers less than or equal to 100 (see A007770).

Crossrefs

Programs

  • Mathematica
    NestList[Total[IntegerDigits[#, 12]^2]&, 6, 144]
    Join[{6, 36, 9, 81, 117, 162, 38, 13, 2, 4, 16, 17},LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 1},{26, 8, 64, 41, 34, 104, 128, 164, 66, 61},54]] (* Ray Chandler, Aug 26 2015 *)
    PadRight[{6,36,9,81,117,162,38,13,2,4,16,17},80,{66,61,26,8,64,41,34,104,128,164}] (* Harvey P. Dale, Aug 06 2017 *)
  • PARI
    a(n) = [6, 36, 9, 81, 117, 162, 38, 13, 2, 4, 16, 17, 26, 8, 64, 41, 34, 104, 128, 164, 66, 61][n%10+10*(n>=10)+10*(n%10<3 & n>=20)]
Previous Showing 11-15 of 15 results.