OFFSET
0,2
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
Lim_{n->infinity} a(n)/n = Pi/2.
a(n) = Sum_{k=0..n} Sum_{d|4*k+1} (-1)^floor(d/2). - Michael Somos [see A008441]
G.f.: 1/(1-x) * Sum_{n>=0} x^n/(1 - x^(4*n + 1)). - Michael Somos [see A008441]
G.f.: theta_2(sqrt(x))^2/(4*x^(1/4)*(1 - x)), where theta_2() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 15 2018
EXAMPLE
G.f.: A(x) = 1 + 3*x + 4*x^2 + 6*x^3 + 8*x^4 + 8*x^5 + 11*x^6 + 13*x^7 + ...
where the g.f. equals the product:
A(x) = 1/(1-x) * (1-x^2)^2/(1-x)^2 * (1-x^4)^2/(1-x^3)^2 * (1-x^6)^2/(1-x^5)^2 * ...
Illustrate the limit a(n)/n = Pi/2:
a(10)/10 = 1.7, a(10^2)/10^2 = 1.58, a(10^3)/10^3 = 1.574, a(10^4)/10^4 = 1.5704, a(10^5)/10^5 = 1.57086, a(10^6)/10^6 = 1.570784, a(10^7)/10^7 = 1.5707972, ...
MATHEMATICA
CoefficientList[Series[EllipticTheta[2, 0, Sqrt[x]]^2/(4*x^(1/4)*(1 - x)), {x, 0, 50}], x] (* G. C. Greubel, Aug 13 2018 *)
a = Compile[{{n, _Integer}}, Block[{c = 0}, Do[ c ++, {i, 0, (1 + Sqrt[1 + 8 n])/4}, {j, 0, (1 + Sqrt[1 + 8(n - i (i + 1))])/2}]; c]]; Array[a, 79, 0] (* Robert G. Wilson v, Aug 28 2025 *)
PROG
(PARI) {a(n)=sum(k=0, n, sumdiv(4*k+1, d, (-1)^(d\2)))}
(PARI) {a(n)=polcoeff(1/(1-x)*prod(m=1, n\2+1, (1-x^(2*m))/(1-x^(2*m-1)+x*O(x^n)))^2, n)}
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Nov 02 2011
STATUS
approved
