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

A064236 Number of decimal digits in A001042.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 5, 10, 19, 38, 76, 152, 303, 605, 1210, 2420, 4839, 9678, 19355, 38709, 77417, 154834, 309667, 619333, 1238665, 2477330, 4954660, 9909319, 19818638, 39637275, 79274549
Offset: 0

Views

Author

Jason Earls, Sep 22 2001

Keywords

Programs

  • Haskell
    a064236 = length . show . a001042  -- Reinhard Zumkeller, Dec 16 2013
  • Mathematica
    a[ 1 ] = 1; a[ 2 ] = 2; a[ n_ ] := a[ n ] = a[ n - 1 ]^2 - a[ n - 2 ]^2; Table[ Floor[ N[ Log[ 10, a[ n ] ], 36 ] ] + 1, {n, 1, 31} ]
    IntegerLength[#]&/@(RecurrenceTable[{a[1]==1,a[2]==2,a[n]==a[n-1]^2- a[n-2]^2},a,{n,31}]) (* Harvey P. Dale, Dec 27 2013 *)
  • PARI
    a(n) = if(n<2,n+1,a(n-1)^2-a(n-2)^2); l(n) = ln=0; while(n,n=floor(n/10); ln++); return(ln); for(n=0,21,print(l(a(n))))
    

Extensions

More terms from Robert G. Wilson v, Sep 24 2001

A062000 a(n) = a(n-1)^2 - a(n-2)^2 with a(0) = 0, a(1) = 2.

Original entry on oeis.org

0, 2, 4, 12, 128, 16240, 263721216, 69548879504781056, 4837046640370554355727482727956480, 23397020201120067002755280700388456275000098577861376610994277515264
Offset: 0

Views

Author

Henry Bottomley, May 29 2001

Keywords

Examples

			a(3) = 4^2 - 2^2 = 12.
		

Crossrefs

Cf. A001042 and A057078 have the same recurrence.
Cf. A061999.

Programs

  • Mathematica
    t = {0, 2}; Do[AppendTo[t, t[[-2]]^2 - t[[-1]]^2], {n, 8}]; Abs[t] (* Vladimir Joseph Stephan Orlovsky, Feb 23 2012 *)
    RecurrenceTable[{a[0]==0, a[1]==2, a[n]==a[n-1]^2 - a[n-2]^2}, a, {n, 0, 10}] (* Vaclav Kotesovec, Dec 17 2014 *)
  • PARI
    { for (n=0, 12, if (n>1, a=a1^2 - a2^2; a2=a1; a1=a, if (n==0, a=a2=0, a=a1=2)); write("b062000.txt", n, " ", a) ) } \\ Harry J. Smith, Jul 29 2009
    
  • SageMath
    def a(n): # a = A062000
        if (n<2): return 2*n
        else: return a(n-1)^2 - a(n-2)^2
    [a(n) for n in (0..14)] # G. C. Greubel, May 01 2022

Formula

a(n) = 2*A061999(n).
a(n) ~ c^(2^n), where c = 1.35388068260888709216374860554901303232201699191445590979673901150215855854... . - Vaclav Kotesovec, Dec 17 2014

Extensions

First term corrected by Harry J. Smith, Jul 29 2009
Showing 1-2 of 2 results.