A058181 Quadratic recurrence a(n) = a(n-1)^2 - a(n-2) for n >= 2 with a(0) = 1 and a(1) = 0.
1, 0, -1, 1, 2, 3, 7, 46, 2109, 4447835, 19783236185116, 391376433956083065015485621, 153175513056180249189030531428945090978436751221570525
Offset: 0
Keywords
Examples
a(6) = a(5)^2 - a(4) = 3^2 - 2 = 7.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..16
- A. V. Aho and N. J. A. Sloane, Some doubly exponential sequences, Fibonacci Quarterly, Vol. 11, No. 4 (1973), pp. 429-437.
- A. V. Aho and N. J. A. Sloane, Some doubly exponential sequences, Fibonacci Quarterly, Vol. 11, No. 4 (1973), pp. 429-437 (original plus references that F.Q. forgot to include - see last page!)
- Index entries for sequences of form a(n+1) = a(n)^2 + ...
Crossrefs
Cf. A058182.
Programs
-
GAP
a:=[1,0];; for n in [3..15] do a[n]:=a[n-1]^2-a[n-2]; od; a; # G. C. Greubel, Jun 09 2019
-
Magma
I:=[1,0]; [n le 2 select I[n] else Self(n-1)^2 - Self(n-2): n in [1..15]]; // G. C. Greubel, Jun 09 2019
-
Mathematica
Join[{a=1,b=0},Table[c=b^2-a;a=b;b=c,{n,13}]] (* Vladimir Joseph Stephan Orlovsky, Jan 18 2011 *) RecurrenceTable[{a[0]==1, a[1]==0, a[n]==a[n-1]^2 - a[n-2]}, a, {n, 13}] (* Vincenzo Librandi, Nov 11 2012 *)
-
PARI
a(n)=if(n<0, a(-1-n), if(n<2, 1-n, a(n-1)^2-a(n-2))) /* Michael Somos, May 05 2005 */
-
Sage
def a(n): if (n==0): return 1 elif (n==1): return 0 else: return a(n-1)^2 - a(n-2) [a(n) for n in (0..15)] # G. C. Greubel, Jun 09 2019
Formula
a(n)^2 = a(n+1) + a(n-1), a(-1-n) = a(n).
For n >= 4, a(n) = ceiling(c^(2^n)) with c=1.0303497388742578142745024606710866\
16436302563960998408889321488508667424048981473368773165340730475719244472111...
and c^(1/4) = 1.0075025785879710605024343257517358... - Benoit Cloitre, Apr 16 2007