OFFSET
1,1
FORMULA
a(1)=2, a(n)=a(n-1)^2+(-1)^n*a(n-1)+(-1)^n
MAPLE
a := proc(n) option remember; if n=1 then 2 else a(n-1)^2+(-1)^n*a(n-1)+(-1)^n fi end:
MATHEMATICA
nxt[{n_, a_}]:={n+1, a^2+(-1)^(n+1) a+(-1)^(n+1)}; Transpose[NestList[nxt, {1, 2}, 10]][[2]] (* Harvey P. Dale, Dec 15 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Walter Kehowski, Aug 18 2005
STATUS
approved