login
a(n) = a(n-1)^2 + (-1)^n with a(1)=1.
0

%I #20 Oct 10 2013 02:39:23

%S 1,2,3,10,99,9802,96079203,9231213249115210,

%T 85215298050640192157847853344099,

%U 7261647021859442133580964784539140878185975659356185857298121802

%N a(n) = a(n-1)^2 + (-1)^n with a(1)=1.

%C From the 4th element, the sum of the digits (modulo 9) of each term gives the sequence A000035.

%F a(n) ~ c^(2^n), where c = 1.15442119601942274770665172928641533277.... - _Vaclav Kotesovec_, Oct 09 2013

%p a := proc (n) if n = 1 then 1 else a(n-1)^2+(-1)^n end if end proc:

%p seq(a(i), i = 1 .. 10);

%t RecurrenceTable[{a[n] == a[n-1]^2 + (-1)^n, a[1]==1},a,{n,1,10}] (* _Vaclav Kotesovec_, Oct 09 2013 *)

%o (PARI) a(n)=if(n==1,1,a(n-1)^2+(-1)^n) \\ _Charles R Greathouse IV_, Sep 16 2013

%Y Cf. A000035.

%K nonn

%O 1,2

%A _Luca Finazzi_, Sep 16 2013