login
A001064
a(n) = a(n-1)*a(n-2) + a(n-3).
(Formerly M0859 N0328)
1
1, 1, 0, 1, 1, 1, 2, 3, 7, 23, 164, 3779, 619779, 2342145005, 1451612289057674, 3399886472013047316638149, 4935316984175079105557291745555191750431, 16779517449593082173916263081219908459297087421776218065830849893
OFFSET
0,7
COMMENTS
The next term, a(18), has 104 digits. - Harvey P. Dale, Dec 12 2018
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..22
MAPLE
a:= proc (n) option remember;
if n < 2 then 1
elif n=2 then 0
else a(n-1)*a(n-2) + a(n-3)
end if
end proc;
seq(a(n), n = 0..20); # G. C. Greubel, Sep 19 2019
MATHEMATICA
t = {1, 1, 0}; Do[AppendTo[t, t[[-1]] * t[[-2]] + t[[-3]]], {n, 3, 20}]; t (* T. D. Noe, Jun 25 2012 *)
RecurrenceTable[{a[0]==a[1]==1, a[2]==0, a[n]==a[n-1]*a[n-2]+a[n-3]}, a, {n, 18}] (* Harvey P. Dale, Dec 12 2018 *)
PROG
(Haskell)
a001064 n = a001064_list !! n
a001064_list = 1 : 1 : 0 : zipWith (+) a001064_list
(tail $ zipWith (*) a001064_list (tail a001064_list))
-- Reinhard Zumkeller, Dec 30 2011
(PARI) m=20; v=concat([1, 1, 0], vector(m-3)); for(n=4, m, v[n]=v[n-1]*v[n-2] +v[n-3]); v \\ G. C. Greubel, Sep 19 2019
(Magma) I:=[1, 1, 0]; [n le 3 select I[n] else Self(n-1)*Self(n-2) + Self(n-3): n in [1..20]]; // G. C. Greubel, Sep 19 2019
(Sage)
def a(n):
if (n==0 or n==1): return 1
elif (n==2): return 0
else: return a(n-1)*a(n-2) + a(n-3)
[a(n) for n in (0..20)] # G. C. Greubel, Sep 19 2019
(GAP) a:=[1, 1, 0];; for n in [4..20] do a[n]:=a[n-1]*a[n-2]+a[n-3]; od; a; # G. C. Greubel, Sep 19 2019
CROSSREFS
Sequence in context: A176706 A281529 A090253 * A108176 A111235 A066356
KEYWORD
nonn,easy
STATUS
approved