OFFSET
1,6
COMMENTS
a(n) is also the number of partitions of n into two parts, the larger being odd (the conjugate of the defining partition). Example: a(10) = 3 because we have 55, 73 and 91. - Emeric Deutsch, Nov 12 2008
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
a(2*n + 1) = a(2*n - 2) = A004526(n).
a(n) = floor((n+2)/4) - [n == 3 mod 4] = floor((1/8)*{2*n - 1 + 3*(-1)^n + 2*(-1)^[(n-1)/2]}). - Ralf Stephan, Jun 09 2005
a(n) = A008624(n-2). - R. J. Mathar, Oct 23 2008
From Emeric Deutsch, Nov 12 2008: (Start)
G.f. = sum(sum(x^(2*i-1+j), j=1..2*i-1), i=1..infinity).
G.f. = x^2*(1-x+x^2)/[(1+x)*(1-x)^2*(1+x^2)]. (End)
From Michael Somos, Oct 14 2008: (Start)
Euler transform of length 6 sequence [ 0, 1, 1, 1, 0, -1].
a(n) = a(n-1) + a(n-4) - a(n-5). a(1 - n) = -a(n).
G.f.: x^2 * (1 - x + x^2) / (1 - x - x^4 + x^5). (End)
EXAMPLE
a(10)=3 because we have 22222, 2221111 and 211111111. - Emeric Deutsch, Nov 12 2008
MAPLE
G:=x^2*(x^2-x+1)/((x+1)*(1-x)^2*(x^2+1)): Gser:= series(G, x=0, 105): seq(coeff(Gser, x, n), n=1..82); # Emeric Deutsch, Nov 12 2008
a := proc(n): if (n mod 4 = 3) then floor((n+2)/4) - 1 else floor((n+2)/4) fi: end: seq(a(n), n=1..82); # Johannes W. Meijer, Oct 10 2013
MATHEMATICA
CoefficientList[Series[x (1 - x + x^2) / (1 - x - x^4 + x^5), {x, 0, 100}], x] (* Vincenzo Librandi, Aug 15 2013 *)
PROG
(PARI) {a(n) = n \ 2 - ((n + 1) \ 4)} /* Michael Somos, Oct 14 2008 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Emeric Deutsch, Nov 12 2008
STATUS
approved