OFFSET
1,3
MAPLE
a[1]:= 0: a[2]:= 1: a[3]:= 2:
for n from 4 to 20 do
a[n]:= a[n-3]*a[n-1]-a[n-2]
od:
seq(a[i], i=1..20); # Robert Israel, Oct 08 2015
MATHEMATICA
nxt[{a_, b_, c_}]:={b, c, a*c-b}; NestList[nxt, {0, 1, 2}, 20][[All, 1]] (* Harvey P. Dale, Feb 02 2022 *)
PROG
(PARI) a(n) = if(n<4, n-1, a(n-3)*a(n-1)-a(n-2));
vector(20, n, a(n)) \\ Altug Alkan, Oct 08 2015
(Magma) [n le 3 select n-1 else Self(n-3)*Self(n-1)-Self(n-2): n in [1..20]]; // Vincenzo Librandi, Oct 09 2015
CROSSREFS
KEYWORD
sign
AUTHOR
Gianmarco Giordano, Oct 08 2015
STATUS
approved