OFFSET
1,1
COMMENTS
This is the Jacobi elliptic function K(q)/Pi - 1/2 [see Fine].
REFERENCES
N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; Eq. (34.4).
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
FORMULA
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = (u-v)^2 - (v-w) * (4*w + 2). - Michael Somos, May 13 2005
a(n) = 2 * A002654(n). - Michael Somos, Jan 25 2017
EXAMPLE
G.f. = 2*q + 2*q^2 + 2*q^4 + 4*q^5 + 2*q^8 + 2*q^9 + 4*q^10 + 4*q^13 + 2*q^16 + ...
MATHEMATICA
CoefficientList[Series[(EllipticTheta[3, 0, x]^2 - 1)/(2 x), {x, 0, 100}], x] (* Jan Mangaldan, Jan 04 2017 *)
a[ n_] := If[ n < 1, 0, SquaresR[ 2, n] / 2]; (* Michael Somos, Jan 25 2017 *)
a[ n_] := If[ n < 1, 0, 2 DivisorSum[ n, KroneckerSymbol[ -4, #] &]]; (* Michael Somos, Jan 25 2017 *)
a[ n_] := SeriesCoefficient[ (EllipticTheta[ 3, 0, q]^2 - 1) / 2, {q, 0, n}]; (* Michael Somos, Jan 25 2017 *)
PROG
(PARI) qfrep([1, 0; 0, 1], 100)
(PARI) {a(n) = if( n<1, 0, qfrep([1, 0; 0, 1], n)[n])}; /* Michael Somos, May 13 2005 */
(PARI) {a(n) = if( n<1, 0, 2 * sumdiv( n, d, (d%4==1) - (d%4==3)))}; /* Michael Somos, Jan 25 2017 */
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 05 2005
STATUS
approved