login
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

%I #5 Jan 24 2016 16:05:51

%S 0,1,2,1,0,3,4,1,6,21,16,31,456,681,1186,208441,671016,1869171,

%T 43448848636,493709451721,3944060830326,1887802451244390439101,

%U 245636825165950759470616,15799364856026522930297791

%N a(0)=0, a(1)=1, a(2)=2; for n>2, a(n) = a(n-1) - a(n-2) + a(n-3)^2.

%o (Perl) -e '@a=(0,1,2); for (3..20){ $a[$_] = $a[$_-1] - $a[$_-2] + $a[$_-3]**2; print "$a[$_],";}'

%o (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

%K easy,nonn

%O 0,3

%A Gamo (gamo(AT)telecable.es), Nov 13 2004

%E More terms from _Klaus Brockhaus_, Nov 14 2004