login
A228443
G.f.: Sum_{k>=0} (2*k + 1) * x^k / (1 + x^(2*k + 1)).
2
1, 2, 6, 6, 7, 10, 14, 12, 18, 18, 12, 22, 31, 20, 30, 30, 20, 36, 38, 28, 42, 42, 42, 46, 43, 36, 54, 60, 36, 58, 62, 42, 84, 66, 44, 70, 74, 62, 60, 78, 61, 82, 108, 60, 90, 84, 60, 108, 98, 70, 102, 102, 72, 106, 110, 76, 114, 132, 98, 108, 111, 84, 156
OFFSET
0,2
LINKS
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
Sequence in context: A110936 A197850 A226043 * A010591 A177934 A318435
KEYWORD
nonn,easy
AUTHOR
Michael Somos, Nov 03 2013
STATUS
approved