OFFSET
0,3
LINKS
Colin Barker, Table of n, a(n) for n = 0..1001
K. Cattel, C. R. Miers, F. Ruskey, J. Sawada, M. Serra, The number of irreducible polynomials over Gf(2) with given trace and subtrace, J. Combin. Math. Combin. Comput. 47 (2003) 31-64.
Index entries for linear recurrences with constant coefficients, signature (0,2,4).
FORMULA
a(n) = C(n, r+0) + C(n, r+4) + C(n, r+8) + ... where r = 3 if n odd, r = 1 if n even.
a(n) = (2^(n-1) - A108520(n-1))/2 if n > 0. - R. J. Mathar, Jan 29 2008
From Colin Barker, Aug 02 2019: (Start)
G.f.: x^2*(2 + x) / ((1 - 2*x)*(1 + 2*x + 2*x^2)).
a(n) = 2*a(n-2) + 4*a(n-3) for n>3.
(End)
MAPLE
A038521 := proc(n) local r, a, i ; if n mod 2 = 1 then r := 3 ; else r := 1 ; fi; a :=0 ; for i from r to n by 4 do a := a+binomial(n, i) ; od; a ; end: for n from 0 to 40 do printf("%d, ", A038521(n)) ; od: # R. J. Mathar, Oct 20 2008
MATHEMATICA
LinearRecurrence[{0, 2, 4}, {0, 0, 2, 1}, 33] (* Jean-François Alcover, May 08 2023 *)
PROG
(PARI) concat([0, 0], Vec(x*(2 + x) / ((1 - 2*x)*(1 + 2*x + 2*x^2)) + O(x^35))) \\ Colin Barker, Aug 02 2019
(Magma) I:=[0, 0, 2, 1]; [m le 4 select I[m] else 2*Self(m-2) + 4*Self(m-3): m in [1..33]]; // Marius A. Burtea, Aug 02 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
EXTENSIONS
Values duplicated A038520 and were replaced by R. J. Mathar, Oct 20 2008
Missing a(0) = 0 inserted by Andrey Zabolotskiy, Nov 12 2024
STATUS
approved