login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A255175
Expansion of phi(-x) / (1 - x)^2 in powers of x where phi() is a Ramanujan theta function.
3
1, 0, -1, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3
OFFSET
0,4
COMMENTS
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
LINKS
Eric Weisstein's World of Mathematics, Ramanujan Theta Functions
FORMULA
G.f.: Product_{k>0} (1 - x^(2*k)) * (1 - x^(2*k+1))^2.
A053615(n) = abs(A196199(n)) = abs(a(n-1)).
Euler transform of -A134451.
a(n) = Sum_{i=0..n}( (-1)^(floor(sqrt(i))) ). - John M. Campbell, Dec 22 2016
EXAMPLE
G.f. = 1 - x^2 - 2*x^3 - x^4 + x^6 + 2*x^7 + 3*x^8 + 2*x^9 + x^10 - x^12 + ...
MATHEMATICA
a[ n_] := SeriesCoefficient[ EllipticTheta[ 4, 0, x] / (1 - x)^2, {x, 0, n}];
a[ n_] := SeriesCoefficient[ Product[ (1 - x^k)^(Mod[k, 2] + 1), {k, 2, n}], {x, 0, n}];
a[ n_] := If[ n < 0, 0, With[{m = Floor[ Sqrt[ n + 1]]}, (-1)^m (n + 1 - m - m^2)]];
Table[Sum[(-1)^(Floor[Sqrt[i]]), {i, 0, n}], {n, 0, 50}] (* G. C. Greubel, Dec 22 2016 *)
PROG
(PARI) {a(n) = my(m); if( n<0, 0, m = sqrtint(n + 1); (-1)^m * (n + 1 - m - m^2))};
(PARI) {a(n) = if( n<0, 0, polcoeff( prod(k=2, n, (1 - x^k)^(k%2+1), 1 + x * O(x^n)), n))};
(Python)
from math import isqrt
def A255175(n): return ((1+(t:=isqrt(n)))*t-n-1)*(1 if t&1 else -1) # Chai Wah Wu, Aug 04 2022
CROSSREFS
Cf. A053615, A134451, A196199, A329116 (essentially the same), A339265 (first differences).
Sequence in context: A324692 A228110 A329116 * A196199 A053615 A002819
KEYWORD
sign
AUTHOR
Michael Somos, Feb 16 2015
STATUS
approved