OFFSET
0,3
COMMENTS
a(n) is the total number of non-isolated "1s" (consecutive 1s on 2 rows, 1 column or 1 row, 2 columns) that appear as rectangles in the Thue-Morse logical matrices after n stages. See links for more details.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Kival Ngaokrajang, Illustration of initial terms
Wikipedia, Thue-Morse sequence
Index entries for linear recurrences with constant coefficients, signature (4,5,-20,-4,16)
FORMULA
G.f.: -4*x^2*(8*x^3-5*x^2-2*x+1) / ((x-1)*(x+1)*(2*x-1)*(2*x+1)*(4*x-1)). - Colin Barker, Apr 27 2014
a(n) = (8 + 3*2^n + 2*4^n + (-1)^n*(24 - 2^n))/18, n>0. - R. J. Mathar, May 04 2014
MATHEMATICA
CoefficientList[Series[-4*x^2*(8*x^3 - 5*x^2 - 2*x + 1)/((x - 1)*(x + 1)*(2*x - 1)*(2*x + 1)*(4*x - 1)), {x, 0, 50}], x] (* G. C. Greubel, Sep 28 2017 *)
PROG
(Small Basic)
a[0] = 0
a[1] = 0
b = 1
For n = 0 To 20
If Math.Remainder(n+2, 2) = 0 Then
a[n+2] = 2*(a[n+1]*2-(4*b-4)) + 4*b
b =b*4 - 2
Else
a[n+2] = a[n+1]*4 - 8
EndIf
TextWindow.Write(a[n]+", ")
EndFor
(PARI) x='x+O('x^50); concat([0, 0], Vec(-4*x^2*(8*x^3-5*x^2-2*x+1)/((x-1)*(x+1)*(2*x-1)*(2*x+1)*(4*x-1)))) \\ G. C. Greubel, Sep 28 2017
(Magma) [(8+3*2^n+2*4^n+(-1)^n*(24-2^n))/18: n in [0..30]]; // Vincenzo Librandi, Sep 29 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Kival Ngaokrajang, Apr 27 2014
EXTENSIONS
Terms a(21) onward added by G. C. Greubel, Sep 28 2017
STATUS
approved