login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A094301
a(0)=0, a(1)=1, a(2)=2; for n>2, a(n) = a(n-1) - a(n-2) + a(n-3)^2.
0
0, 1, 2, 1, 0, 3, 4, 1, 6, 21, 16, 31, 456, 681, 1186, 208441, 671016, 1869171, 43448848636, 493709451721, 3944060830326, 1887802451244390439101, 245636825165950759470616, 15799364856026522930297791
OFFSET
0,3
PROG
(Perl) -e '@a=(0, 1, 2); for (3..20){ $a[$_] = $a[$_-1] - $a[$_-2] + $a[$_-3]**2; print "$a[$_], "; }'
(PARI) print1(c=0, ", ", b=1, ", "a=2, ", "); for(n=1, 21, print1(d=a-b+c^2, ", "); c=b; b=a; a=d) \\ Klaus Brockhaus
CROSSREFS
Sequence in context: A124030 A166040 A106378 * A221542 A221463 A135488
KEYWORD
easy,nonn
AUTHOR
Gamo (gamo(AT)telecable.es), Nov 13 2004
EXTENSIONS
More terms from Klaus Brockhaus, Nov 14 2004
STATUS
approved