OFFSET
0,2
COMMENTS
LINKS
Kival Ngaokrajang, Illustration of initial terms
Kival Ngaokrajang, illustration for n = 6
Wikipedia, Thue-Morse sequence
Index entries for linear recurrences with constant coefficients, signature (4,5,-20,-4,16).
FORMULA
G.f.: ( -1+2*x+8*x^2-8*x^3-8*x^4 ) / ( (x-1)*(4*x-1)*(1+2*x)*(2*x-1)*(1+x) ). - R. J. Mathar, May 04 2014
18*a(n) = 7+6*2^n +4^(n+1) +(-1)^n*( 3-2^(n+1) ). - R. J. Mathar, May 04 2014
MATHEMATICA
LinearRecurrence[{4, 5, -20, -4, 16}, {1, 2, 5, 18, 61}, 30] (* Harvey P. Dale, Aug 02 2016 *)
PROG
(PARI){a0=1; print1(a0, ", "); for (n=2, 50, b=(2^(n+1)+3+(-1)^n)/6; a=floor(b^2/2); if(Mod(n, 2)==1, a=a+1); print1(a, ", "))}
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Kival Ngaokrajang, May 01 2014
STATUS
approved