OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
FORMULA
a(n) = b(2*n + 1) where b() is multiplicative with b(2^e) = 0^e, b(p^e) = (p^(e+1) - 1) / (p - 1) if p == 1 (mod 4), b(p^e) = (p^(e+1) + (-1)^e) / (p + 1) if p == 3 (mod 4), with a(0) = 1.
G.f.: Sum_{k>=0} (-1)^k * x^k * (1 + x^(2*k + 1)) / (1 - x^(2*k + 1))^2
a(2*n - 1) = 2 * A053091(n).
Sum_{k=1..n} a(k) ~ c * n^2, where c = 0.915965... is Catalan's constant (A006752). - Amiram Eldar, Dec 30 2023
EXAMPLE
G.f. = 1 + 2*x + 6*x^2 + 6*x^3 + 7*x^4 + 10*x^5 + 14*x^6 + 12*x^7 + 18*x^8 + ...
G.f. = q + 2*q^3 + 6*q^5 + 6*q^7 + 7*q^9 + 10*q^11 + 14*q^13 + 12*q^15 + ...
MATHEMATICA
a[ n_] := If[ n < 0, 0, With[{m = 2 n + 1}, (-1)^n Sum[ (-1)^Quotient[k, 2] k, {k, Divisors@m}]]];
PROG
(PARI) {a(n) = if( n<0, 0, polcoeff( sum( k=0, n, (2*k + 1) * x^k / (1 + x^(2*k + 1)), x * O(x^n)), n))};
(PARI) {a(n) = my(A, p, e); if( n<0, 0, n = 2*n + 1; A = factor( n); prod( k=1, matsize(A)[1], if(p = A[k, 1], e = A[k, 2]; if( p==2, 0, if( p%4==1, (p^(e+1) - 1) / (p - 1), (p^(e+1) + (-1)^e) / (p + 1))))))};
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael Somos, Nov 03 2013
STATUS
approved