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-4 of 4 results.

A030132 Digital root of Fibonacci(n).

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 4, 3, 7, 1, 8, 9, 8, 8, 7, 6, 4, 1, 5, 6, 2, 8, 1, 9, 1, 1, 2, 3, 5, 8, 4, 3, 7, 1, 8, 9, 8, 8, 7, 6, 4, 1, 5, 6, 2, 8, 1, 9, 1, 1, 2, 3, 5, 8, 4, 3, 7, 1, 8, 9, 8, 8, 7, 6, 4, 1, 5, 6, 2, 8, 1, 9, 1, 1, 2, 3, 5, 8, 4, 3, 7, 1, 8, 9, 8, 8
Offset: 0

Views

Author

youngelder(AT)webtv.net (Ana)

Keywords

Comments

Any initial pair (a(0), a(1)) of nonzero single-digit numbers enters a cycle of length 24, except for the 8 cases where 3 divides both a(0), a(1) and (a(0), a(1)) != (9, 9), which enter a cycle of length 8 and (9, 9), which is immediately periodic of period length 1. - Jonathan Vos Post, Dec 29 2005 [Corrected by Jianing Song, Apr 17 2021]
First term that differs from A004090 is a(10). In general, all terms of A004090 having one digit are the same in this sequence. - Alonso del Arte, Sep 16 2012
Decimal expansion of 12484270798876404618091 / 1111111111111111111111110 = 0.0[112358437189887641562819] (periodic). - Daniel Forgues, Feb 27 2017

Examples

			a(10) = 1 because F(10) = 55, and since 5 + 5 = 10 and 1 + 0 = 1 is the digital root of 55.
		

Crossrefs

Cf. A000045 (Fibonacci numbers), A010888 (digital roots), A004090, A007953, A030133.

Programs

  • Haskell
    a030132 n = a030132_list !! n
    a030132_list =
       0 : 1 : map a007953 (zipWith (+) a030132_list (tail a030132_list))
    -- Reinhard Zumkeller, Aug 20 2011
    
  • Mathematica
    digitalRoot[n_Integer?Positive] := FixedPoint[Plus@@IntegerDigits[#]&, n]; Table[If[n == 0, 0, digitalRoot[Fibonacci[n]]], {n, 0, 100}] (* Vladimir Joseph Stephan Orlovsky, May 02 2011 *)
    Table[NestWhile[Total[IntegerDigits[#]]&, Fibonacci[n], # > 9 &], {n, 0, 90}] (* Harvey P. Dale, May 07 2012 *)
    PadRight[{0},120,{9,1,1,2,3,5,8,4,3,7,1,8,9,8,8,7,6,4,1,5,6,2,8,1}] (* Harvey P. Dale, Jul 20 2024 *)
  • PARI
    a(n)=if(n,(fibonacci(n)-1)%9+1,0) \\ Charles R Greathouse IV, Jan 23 2013

Formula

a(n + 1) = sum of digits of (a(n) + a(n - 1)).
Periodic with period 24 = A001175(9) given by {1, 1, 2, 3, 5, 8, 4, 3, 7, 1, 8, 9, 8, 8, 7, 6, 4, 1, 5, 6, 2, 8, 1, 9}.
a(n) + a(n + 1) = A010077(n + 4); a(A017641(n)) = 9. - Reinhard Zumkeller, Jul 04 2007
G.f.: x*( -1 -x -2*x^2 -3*x^3 -5*x^4 -8*x^5 -4*x^6 -3*x^7 -7*x^8 -x^9 -8*x^10 -9*x^11 -8*x^12 -8*x^13 -7*x^14 -6*x^15 -4*x^16 -x^17 -5*x^18 -6*x^19 -2*x^20 -8*x^21 -x^22 -9*x^23 ) / ( (x-1) *(1+x+x^2) *(1+x) *(1-x+x^2) *(1+x^2) *(x^4-x^2+1) *(1+x^4) *(x^8-x^4+1) ). - R. J. Mathar, Feb 08 2013

Extensions

Entry revised by N. J. A. Sloane, Aug 29 2004

A010077 a(n) = sum of digits of a(n-1) + sum of digits of a(n-2); a(0) = 0, a(1) = 1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The digital sum analog (in base 10) of the Fibonacci recurrence. - Hieronymus Fischer, Jun 27 2007
a(n) and Fibonacci(n) = A000045(n) are congruent modulo 9 which implies that (a(n) mod 9) is equal to (Fibonacci(n) mod 9) = A007887(n). Thus (a(n) mod 9) is periodic with the Pisano period A001175(9)=24. - Hieronymus Fischer, Jun 27 2007
a(n) == A004090(n) (mod 9) (A004090(n) = digital sum of Fibonacci(n)). - Hieronymus Fischer, Jun 27 2007
For general bases p > 2, we have the inequality 2 <= a(n) <= 2p-3 (for n > 2). Actually, a(n) <= 17 = A131319(10) for the base p=10. - Hieronymus Fischer, Jun 27 2007

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = Apply[ Plus, IntegerDigits[ a[n - 1] ]] + Apply[ Plus, IntegerDigits[ a[n - 2] ]]; Table[ a[n], {n, 0, 100} ]
    nxt[{a_,b_}]:={b, Total[IntegerDigits[a]]+Total[IntegerDigits[b]]}; NestList[ nxt,{0,1},80][[All,1]] (* Harvey P. Dale, Apr 15 2018 *)
  • PARI
    first(n) = {n = max(n, 2); my(res = vector(n)); res[2] = 1; for(i = 3, n, res[i] = sumdigits(res[i-1]) + sumdigits(res[i-2]) ); res } \\ David A. Corneth, May 26 2021

Formula

Periodic from n=3 with period 24. - Franklin T. Adams-Watters, Mar 13 2006
a(n) = A030132(n-4) + A030132(n-3) for n>3. - Reinhard Zumkeller, Jul 04 2007
a(n) = a(n-1) + a(n-2) - 9*(floor(a(n-1)/10) + floor(a(n-2)/10)). - Hieronymus Fischer, Jun 27 2007
a(n) = floor(a(n-1)/10) + floor(a(n-2)/10) + (a(n-1) mod 10) + (a(n-2) mod 10). - Hieronymus Fischer, Jun 27 2007
a(n) = A059995(a(n-1)) + A059995(a(n-2)) + A010879(a(n-1)) + A010879(a(n-2)). - Hieronymus Fischer, Jun 27 2007
a(n) = Fibonacci(n) - 9*Sum_{k=2..n-1} Fibonacci(n-k+1)*floor(a(k)/10) where Fibonacci(n) = A000045(n). - Hieronymus Fischer, Jun 27 2007

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

A065124 a(n) = (sum of digits of a(n-2)) + a(n-1); a(0) = 0 and a(1) = 1.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 13, 21, 25, 28, 35, 45, 53, 62, 70, 78, 85, 100, 113, 114, 119, 125, 136, 144, 154, 163, 173, 183, 194, 206, 220, 228, 232, 244, 251, 261, 269, 278, 295, 312, 328, 334, 347, 357, 371, 386, 397, 414, 433, 442, 452, 462, 473, 485, 499, 516
Offset: 0

Views

Author

Robert G. Wilson v, Nov 13 2001

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = Apply[ Plus, IntegerDigits[ a[n - 2] ]] + a[n - 1]; Table[ a[n], {n, 0, 100} ]
  • PARI
    { for (n=0, 1000, if (n>1, a=sumdigits(a2) + a1; a2=a1; a1=a, if (n, a=a1=1, a=a2=0)); write("b065124.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 10 2009

Formula

A010888(a(n)) = A030132(n). - Davide Rotondo, Dec 02 2024
Showing 1-4 of 4 results.