|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,7
|
|
COMMENTS
|
|
|
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
|
|
|
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;
|
|
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))
(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)
(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
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|