cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-20 of 1364 results. Next

A004018 Theta series of square lattice (or number of ways of writing n as a sum of 2 squares). Often denoted by r(n) or r_2(n).

Original entry on oeis.org

1, 4, 4, 0, 4, 8, 0, 0, 4, 4, 8, 0, 0, 8, 0, 0, 4, 8, 4, 0, 8, 0, 0, 0, 0, 12, 8, 0, 0, 8, 0, 0, 4, 0, 8, 0, 4, 8, 0, 0, 8, 8, 0, 0, 0, 8, 0, 0, 0, 4, 12, 0, 8, 8, 0, 0, 0, 0, 8, 0, 0, 8, 0, 0, 4, 16, 0, 0, 8, 0, 0, 0, 4, 8, 8, 0, 0, 0, 0, 0, 8, 4, 8, 0, 0, 16, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 8, 4, 0, 12, 8
Offset: 0

Views

Author

Keywords

Comments

Number of points in square lattice on the circle of radius sqrt(n). Equivalently, number of Gaussian integers of norm n (cf. Conway-Sloane, p. 106).
Let b(n)=A004403(n), then Sum_{k=1..n} a(k)*b(n-k) = 1. - John W. Layman
Theta series of D_2 lattice.
Number 6 of the 74 eta-quotients listed in Table I of Martin (1996).
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
The zeros in this sequence correspond to those integers with an equal number of 4k+1 and 4k+3 divisors, or equivalently to those that have at least one 4k+3 prime factor with an odd exponent (A022544). - Ant King, Mar 12 2013
If A(q) = 1 + 4*q + 4*q^2 + 4*q^4 + 8*q^5 + ... denotes the o.g.f. of this sequence then the function F(q) := 1/4*(A(q^2) - A(q^4)) = ( Sum_{n >= 0} q^(2*n+1)^2 )^2 is the o.g.f. for counting the ways a positive integer n can be written as the sum of two positive odd squares. - Peter Bala, Dec 13 2013
Expansion coefficients of (2/Pi)*K, with the real quarter period K of elliptic functions, as series of the Jacobi nome q, due to (2/Pi)*K = theta_3(0,q)^2. See, e.g., Whittaker-Watson, p. 486. - Wolfdieter Lang, Jul 15 2016
Sum_{k=0..n} a(n) = A057655(n). Robert G. Wilson v, Dec 22 2016
Limit_{n->oo} (a(n)/n - Pi*log(n)) = A062089: Sierpinski's constant. - Robert G. Wilson v, Dec 22 2016
The mean value of a(n) is Pi, see A057655 for more details. - M. F. Hasler, Mar 20 2017

Examples

			G.f. = 1 + 4*q + 4*q^2 + 4*q^4 + 8*q^5 + 4*q^8 + 4*q^9 + 8*q^10 + 8*q^13 + 4*q^16 + 8*q^17 + 4*q^18 + 8*q^20 + 12*q^25 + 8*q^26 + ... . - _John Cannon_, Dec 30 2006
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 162, #16 (7), r(n).
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 78, Eq. (32.23).
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 15, p. 32, Lemma 2 (with the proof), p. 116, (9.10) first formula.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 133.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 240, r(n).
  • W. König and J. Sprekels, Karl Weierstraß (1815-1897), Springer Spektrum, Wiesbaden, 2016, p. 186-187 and p. 280-281.
  • C. D. Olds, A. Lax and G. P. Davidoff, The Geometry of Numbers, Math. Assoc. Amer., 2000, p. 51.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 244-245.
  • E. T. Whittaker and G. N. Watson, A Course of Modern Analysis, fourth edition, reprinted, 1958, Cambridge at the University Press.

Crossrefs

Row d=2 of A122141 and of A319574, 2nd column of A286815.
Partial sums - 1 give A014198.
A071385 gives records; A071383 gives where records occur.

Programs

  • Julia
    # JacobiTheta3 is defined in A000122.
    A004018List(len) = JacobiTheta3(len, 2)
    A004018List(102) |> println # Peter Luschny, Mar 12 2018
    
  • Magma
    Basis( ModularForms( Gamma1(4), 1), 100) [1]; /* Michael Somos, Jun 10 2014 */
    
  • Maple
    (sum(x^(m^2),m=-10..10))^2;
    # Alternative:
    A004018list := proc(len) series(JacobiTheta3(0, x)^2, x, len+1);
    seq(coeff(%, x, j), j=0..len-1) end:
    t1 := A004018list(102);
    r2 := n -> t1[n+1]; # Peter Luschny, Oct 02 2018
  • Mathematica
    SquaresR[2,Range[0,110]] (* Harvey P. Dale, Oct 10 2011 *)
    a[ n_] := SquaresR[ 2, n]; (* Michael Somos, Nov 15 2011 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q]^2, {q, 0, n}]; (* Michael Somos, Nov 15 2011 *)
    a[ n_] := With[{m = InverseEllipticNomeQ @ q}, SeriesCoefficient[ EllipticK[ m] / (Pi/2), {q, 0, n}]]; (* Michael Somos, Jun 10 2014 *)
    a[ n_] := If[ n < 1, Boole[n == 0], 4 Sum[ KroneckerSymbol[-4, d], {d, Divisors@n}]]; (* or *) a[ n_] := SeriesCoefficient[ QPochhammer[ q^2]^10/(QPochhammer[ q] QPochhammer[ q^4])^4, {q, 0, n}]; (* Michael Somos, May 17 2015 *)
  • PARI
    {a(n) = polcoeff( 1 + 4 * sum( k=1, n, x^k / (1 + x^(2*k)), x * O(x^n)), n)}; /* Michael Somos, Mar 14 2003 */
    
  • PARI
    {a(n) = if( n<1, n==0, 4 * sumdiv( n, d, (d%4==1) - (d%4==3)))}; /* Michael Somos, Jul 19 2004 */
    
  • PARI
    {a(n) = if( n<1, n==0, 2 * qfrep([ 1, 0; 0, 1], n)[n])}; /* Michael Somos, May 13 2005 */
    
  • PARI
    a(n)=if(n==0,return(1)); my(f=factor(n)); 4*prod(i=1,#f~, if(f[i,1]%4==1, f[i,2]+1, if(f[i,2]%2 && f[i,1]>2, 0, 1))) \\ Charles R Greathouse IV, Sep 02 2015
    
  • Python
    from sympy import factorint
    def a(n):
        if n == 0: return 1
        an = 4
        for pi, ei in factorint(n).items():
           if pi%4 == 1: an *= ei+1
           elif pi%4 == 3 and ei%2: return 0
        return an
    print([a(n) for n in range(102)]) # Michael S. Branicky, Sep 24 2021
    
  • Python
    from math import prod
    from sympy import factorint
    def A004018(n): return prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in factorint(n).items())<<2 if n else 1 # Chai Wah Wu, Jul 07 2022, corrected Jun 21 2024.
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1]*2)
    Q.representation_number_list(102) # Peter Luschny, Jun 20 2014
    

Formula

Expansion of theta_3(q)^2 = (Sum_{n=-oo..+oo} q^(n^2))^2 = Product_{m>=1} (1-q^(2*m))^2 * (1+q^(2*m-1))^4; convolution square of A000122.
Factor n as n = p1^a1 * p2^a2 * ... * q1^b1 * q2^b2 * ... * 2^c, where the p's are primes == 1 (mod 4) and the q's are primes == 3 (mod 4). Then a(n) = 0 if any b is odd, otherwise a(n) = 4*(1 + a1)*(1 + a2)*...
G.f. = s(2)^10/(s(1)^4*s(4)^4), where s(k) := subs(q=q^k, eta(q)) and eta(q) is Dedekind's function, cf. A010815. [Fine]
a(n) = 4*A002654(n), n > 0.
Expansion of eta(q^2)^10 / (eta(q) * eta(q^4))^4 in powers of q. - Michael Somos, Jul 19 2004
Expansion of ( phi(q)^2 + phi(-q)^2 ) / 2 in powers of q^2 where phi() is a Ramanujan theta function.
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. - Michael Somos, Jul 19 2004
Euler transform of period 4 sequence [4, -6, 4, -2, ...]. - Michael Somos, Jul 19 2004
Moebius transform is period 4 sequence [4, 0, -4, 0, ...]. - Michael Somos, Sep 17 2007
G.f. is a period 1 Fourier series which satisfies f(-1 / (4 t)) = 2 (t/i) f(t) where q = exp(2 Pi i t).
The constant sqrt(Pi)/Gamma(3/4)^2 produces the first 324 terms of the sequence when expanded in base exp(Pi), 450 digits of the constant are necessary. - Simon Plouffe, Mar 03 2011
a(n) = A004531(4*n). a(n) = 2*A105673(n), if n>0.
Let s = 16*q*(E1*E4^2/E2^3)^8 where Ek = Product_{n>=1} (1-q^(k*n)) (s=k^2 where k is elliptic k), then the g.f. is hypergeom([+1/2, +1/2], [+1], s) (expansion of 2/Pi*ellipticK(k) in powers of q). - Joerg Arndt, Aug 15 2011
Dirichlet g.f. Sum_{n>=1} a(n)/n^s = 4*zeta(s)*L_(-4)(s), where L is the D.g.f. of the (shifted) A056594. [Raman. J. 7 (2003) 95-127]. - R. J. Mathar, Jul 02 2012
a(n) = floor(1/(n+1)) + 4*floor(cos(Pi*sqrt(n))^2) - 4*floor(cos(Pi*sqrt(n/2))^2) + 8*Sum_{i=1..floor(n/2)} floor(cos(Pi*sqrt(i))^2)*floor(cos(Pi*sqrt(n-i))^2). - Wesley Ivan Hurt, Jan 09 2013
From Wolfdieter Lang, Aug 01 2016: (Start)
A Jacobi identity: theta_3(0, q)^2 = 1 + 4*Sum_{r>=0} (-1)^r*q^(2*r+1)/(1 - q^(2*r+1)). See, e.g., the Grosswald reference (p. 15, p. 116, but p. 32, Lemma 2 with the proof, has the typo r >= 1 instead of r >= 0 in the sum, also in the proof). See the link with the Jacobi-Legendre letter.
Identity used by Weierstraß (see the König-Sprekels book, p. 187, eq. (5.12) and p. 281, with references, but there F(x) from (5.11) on p. 186 should start with nu =1 not 0): theta_3(0, q)^2 = 1 + 4*Sum_{n>=1} q^n/(1 + q^(2*n)). Proof: similar to the one of the preceding Jacobi identity. (End)
a(n) = (4/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017
G.f.: Theta_3(q)^2 = hypergeometric([1/2, 1/2],[1],lambda(q)), with lambda(q) = Sum_{j>=1} A115977(j)*q^j. See the Kontsevich and Zagier link, with Theta -> Theta_3, z -> 2*z and q -> q^2. - Wolfdieter Lang, May 27 2018

A081362 Expansion of q^(1/24) * eta(q) / eta(q^2) in powers of q.

Original entry on oeis.org

1, -1, 0, -1, 1, -1, 1, -1, 2, -2, 2, -2, 3, -3, 3, -4, 5, -5, 5, -6, 7, -8, 8, -9, 11, -12, 12, -14, 16, -17, 18, -20, 23, -25, 26, -29, 33, -35, 37, -41, 46, -49, 52, -57, 63, -68, 72, -78, 87, -93, 98, -107, 117, -125, 133, -144, 157, -168, 178, -192, 209, -223, 236, -255, 276, -294, 312, -335, 361, -385
Offset: 0

Views

Author

Michael Somos, Mar 18 2003

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
(Number of partitions of n into an even number of parts) - (number of partitions of n into an odd number of parts). [Fine]
Number 3 of the 130 identities listed in Slater 1952. - Michael Somos, Aug 20 2015

Examples

			G.f. = 1 - x - x^3 + x^4 - x^5 + x^6 - x^7 + 2*x^8 - 2*x^9 + 2*x^10 - 2*x^11 + ...
G.f. = 1/q - q^23 - q^71 + q^95 - q^119 + q^143 - q^167 + 2*q^191 - 2*q^215 + ...
		

References

  • B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 425, Corollary 1, Eqs. (37)-(40).
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 38, Eq. (22.14).

Crossrefs

Programs

  • Mathematica
    a[ n_] := SeriesCoefficient[ Product[1 - x^k, {k, 1, n, 2}], {x, 0, n}];
    a[ n_] := With[ {t = Log[q] / (2 Pi I)}, SeriesCoefficient[ q^(1/24) DedekindEta[t] / DedekindEta[2 t], {q, 0, n}]];
    a[ n_] := SeriesCoefficient[ QHypergeometricPFQ[ {}, {}, x^2, x], {x, 0, n}]; (* Michael Somos, Jan 02 2015 *)
    a[ n_] := SeriesCoefficient[ 1 / QPochhammer[ -x, x], {x, 0, n}]; (* Michael Somos, Jan 02 2015 *)
    a[ n_] := SeriesCoefficient[ 1 / Product[ 1 + x^k, {k, n}], {x, 0, n}]; (* Michael Somos, Jan 02 2015 *)
    a[ n_] := SeriesCoefficient[ QPochhammer[ x, x^2], {x, 0, n}]; (* Michael Somos, Jan 02 2015 *)
    a[ n_] := SeriesCoefficient[ QHypergeometricPFQ[ {}, {-1}, x, -1] 2, {x, 0, n}]; (* Michael Somos, May 11 2015 *)
    a[ n_] := With[ {m = InverseEllipticNomeQ @ q}, SeriesCoefficient[ (m / ( 1 - m)^2 / (16 q))^(-1/24), {q, 0, n}]]; (* Michael Somos, May 11 2015 *)
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x + A) / eta(x^2 + A), n))};
    
  • Sage
    from sage.combinat.partition import number_of_partitions_length
    print([sum((-1)^k*number_of_partitions_length(n, k) for k in (0..n)) for n in (0..69)]) # Peter Luschny, Aug 03 2015

Formula

G.f.: Product_{k>0} (1 - x^(2*k-1)) = Product_{k>0} 1 / (1 + x^k) = 1 + Sum_{k>0} (-x)^k / (Product_{i=1..k} (1 - x^i)).
a(n) = A027187(n)-A027193(n). [Fine]
This is the convolution inverse of A000009 (partitions into distinct parts) - i.e. the negation of the INVERTi transform of A000009. - Franklin T. Adams-Watters, Jan 06 2006
Expansion of chi(-x) = chi(-x^2) / chi(x) = phi(-x) / f(-x) = phi(-x^2) / f(x) = psi(-x) / f(-x^4) = f(-x) / f(-x^2) = f(-x^2) / psi(x) in powers of x where chi(), psi(), phi(), f() are Ramanujan theta functions.
Expansion of chi(x) * chi(-x) = f(x) / psi(x) = f(-x) / psi(-x) in powers of x^2 where chi(), psi(), f() are Ramanujan theta functions.
Expansion of f(-x, -x^5) / psi(x^3) = phi(-x^3) / f(x, x^2) in powers of x where phi(), psi(), f() are Ramanujan theta functions. - Michael Somos, Jun 03 2015
Given g.f. A(x), then B(q) = A(q^3)^8 / q satisfies 0 = f(B(q), B(q^2)) where f(u, v) = u^2*v + 16*u - v^2.
G.f. A(x) satisfies A(x^2) = A(x) * A(-x).
G.f. is a period 1 Fourier series which satisfies f(-1 / (1152 t)) = 2^(1/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A000009.
Euler transform of period 2 sequence [ -1, 0, ...].
Expansion of q^(1/24) * f1(t) in powers of q = exp(Pi i t) where f1() is a Weber function.
a(n) = (-1)^n * A000700(n). a(2*n) = A069910(n). a(2*n + 1) = - A069911(n).
a(n) ~ (-1)^n * exp(Pi*sqrt(n/6)) / (2*24^(1/4)*n^(3/4)). - Vaclav Kotesovec, Feb 25 2015
a(n) = Sum_{k = 0..n} (-1)^k*A072233(n,k). - Peter Luschny, Aug 03 2015
G.f.: Sum_{k>=0} (-1)^k * x^k^2 / (Product_{i=1..k} (1 - x^(2*i))). - Michael Somos, Aug 20 2015
Sum_{j>=0} a(n-A000217(j)) = 0 if n not in A152749, = (-1)^k if n is in A152749, n=k*(3*k-1). [Merca, Corollary 4.1] - R. J. Mathar, Jun 18 2016
a(n) = -(1/n)*Sum_{k=1..n} A000593(k)*a(n-k), a(0) = 1. - Seiichi Manyama, Mar 25 2017
G.f.: exp(Sum_{k>=1} (-1)^k*x^k/(k*(1 - x^k))). - Ilya Gutkovskiy, May 28 2018
G.f.: (1 - x) * Sum_{k >= 0} (-1)^k * x^(k*(k+2)) / (Product_{i = 1..k} (1 - x^(2*i))) = (1 - x)*(1 - x^3) * Sum_{k >= 0} (-1)^k * x^(k*(k+4)) / (Product_{i = 1..k} (1 - x^(2*i)))= (1 - x)*(1 - x^3)*(1 - x^5) *
Sum_{k >= 0} (-1)^k * x^(k*(k+6)) / (Product_{i = 1..k} (1 - x^(2*i))) = .... - Peter Bala, Jan 15 2021

A005875 Theta series of simple cubic lattice; also number of ways of writing a nonnegative integer n as a sum of 3 squares (zero being allowed).

Original entry on oeis.org

1, 6, 12, 8, 6, 24, 24, 0, 12, 30, 24, 24, 8, 24, 48, 0, 6, 48, 36, 24, 24, 48, 24, 0, 24, 30, 72, 32, 0, 72, 48, 0, 12, 48, 48, 48, 30, 24, 72, 0, 24, 96, 48, 24, 24, 72, 48, 0, 8, 54, 84, 48, 24, 72, 96, 0, 48, 48, 24, 72, 0, 72, 96, 0, 6, 96, 96, 24, 48, 96, 48, 0, 36, 48, 120
Offset: 0

Views

Author

Keywords

Comments

Number of ordered triples (i, j, k) of integers such that n = i^2 + j^2 + k^2.
The Madelung Coulomb energy for alternating unit charges in the simple cubic lattice is Sum_{n>=1} (-1)^n*a(n)/sqrt(n) = -A085469. - R. J. Mathar, Apr 29 2006
a(A004215(k))=0 for k=1,2,3,... but no other elements of {a(n)} are zero. - Graeme McRae, Jan 15 2007

Examples

			Order and signs are taken into account: a(1) = 6 from 1 = (+-1)^2 + 0^2 + 0^2, a(2) = 12 from 2 = (+-1)^2 + (+-1)^2 + 0^2; a(3) = 8 from 3 = (+-1)^2 + (+-1)^2 + (+-1)^2, etc.
G.f. =  1 + 6*q + 12*q^2 + 8*q^3 + 6*q^4 + 24*q^5 + 24*q^6 + 12*q^8 + 30*q^9 + 24*q^10 + ...
		

References

  • H. Cohen, Number Theory, Vol. 1: Tools and Diophantine Equations, Springer-Verlag, 2007, p. 317.
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 107.
  • H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 7th ed., 1999, Chapter V.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 3, p. 109.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 54.
  • L. Kronecker, Crelle, Vol. LVII (1860), p. 248; Werke, Vol. IV, p. 188.
  • C. J. Moreno and S. S. Wagstaff, Jr., Sums of Squares of Integers, Chapman and Hall, 2006, p. 43.
  • T. Nagell, Introduction to Number Theory, Wiley, 1951, p. 194.
  • W. Sierpiński, 1925. Teorja Liczb. pp. 1-410 (p.61).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • H. J. S. Smith, Report on the Theory of Numbers, reprinted in Vol. 1 of his Collected Math. Papers, Chelsea, NY, 1979, see p. 338, Eq. (B').

Crossrefs

Row d=3 of A122141 and of A319574, 3rd column of A286815.
Cf. A074590 (primitive solutions), A117609 (partial sums), A004215 (positions of zeros).
Analog for 4 squares: A000118.
x^2+y^2+k*z^2: A005875, A014455, A034933, A169783, A169784.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Programs

  • Julia
    # JacobiTheta3 is defined in A000122.
    A005875List(len) = JacobiTheta3(len, 3)
    A005875List(75) |> println # Peter Luschny, Mar 12 2018
    
  • Magma
    Basis( ModularForms( Gamma1(4), 3/2), 75) [1]; /* Michael Somos, Jun 25 2014 */
    
  • Maple
    (sum(x^(m^2),m=-10..10))^3; seq(coeff(%,x,n), n=0..50);
    Alternative:
    A005875list := proc(len) series(JacobiTheta3(0, x)^3, x, len+1);
    seq(coeff(%, x, j), j=0..len-1) end: A005875list(75); # Peter Luschny, Oct 02 2018
  • Mathematica
    SquaresR[3,Range[0,80]] (* Harvey P. Dale, Jul 21 2011 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q]^3, {q, 0, n}]; (* Michael Somos, Jun 25 2014 *)
    a[ n_] := Length @ FindInstance[ n == x^2 + y^2 + z^2, {x, y, z}, Integers, 10^9]; (* Michael Somos, May 21 2015 *)
    QP = QPochhammer; CoefficientList[(QP[q^2]^5/(QP[q]*QP[q^4])^2)^3 + O[q]^80, q] (* Jean-François Alcover, Nov 24 2015 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum( k=1, sqrtint(n), 2 * x^k^2, 1 + x * O(x^n))^3, n))};
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A)^5 / (eta(x + A) * eta(x^4 + A))^2)^3, n))}; /* Michael Somos, Jun 03 2012 */
    
  • PARI
    {a(n) = my(G); if( n<0, 0, G = [ 1, 0, 0; 0, 1, 0; 0, 0, 1]; polcoeff( 1 + 2 * x * Ser( qfrep( G, n)), n))}; /* Michael Somos, May 21 2015 */
    
  • Python
    # uses Python code for A004018
    from math import isqrt
    def A005875(n): return A004018(n)+(sum(A004018(n-k**2) for k in range(1,isqrt(n)+1))<<1) # Chai Wah Wu, Jun 21 2024
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1]*3)
    Q.representation_number_list(75) # Peter Luschny, Jun 20 2014
    

Formula

A number n is representable as the sum of 3 squares iff n is not of the form 4^a (8k+7) (cf. A000378).
There is a classical formula (essentially due to Gauss):
For sums of 3 squares r_3(n): write (uniquely) -n=D(2^vf)^2, with D<0 fundamental discriminant, f odd, v>=-1. Then r_3(n) = 12L((D/.),0)(1-(D/2)) Sum_{d | f} mu(d)(D/d)sigma(f/d).
Here mu is the Moebius function, (D/2) and (D/d) are Kronecker-Legendre symbols, sigma is the sum of divisors function, L((D/.),0)=h(D)/(w(D)/2) is the value at 0 of the L function of the quadratic character (D/.), equal to the class number h(D) divided by 2 or 3 in the special cases D=-4 and -3. - Henri Cohen (Henri.Cohen(AT)math.u-bordeaux1.fr), May 12 2010
a(n) = 3*T(n) if n == 1,2,5,6 mod 8, = 2*T(n) if n == 3 mod 8, = 0 if n == 7 mod 8 and = a(n/4) if n == 0 mod 4, where T(n) = A117726(n). [Moreno-Wagstaff].
"If 12E(n) is the number of representations of n as a sum of three squares, then E(n) = 2F(n) - G(n) where G(n) = number of classes of determinant -n, F(n) = number of uneven classes." - Dickson, quoting Kronecker. [Cf. A117726.]
a(n) = Sum_{d^2|n} b(n/d^2), where b() = A074590() gives the number of primitive solutions.
Expansion of phi(q)^3 in powers of q where phi() is a Ramanujan theta function. - Michael Somos, Oct 25 2006.
Euler transform of period 4 sequence [ 6, -9, 6, -3, ...]. - Michael Somos, Oct 25 2006
G.f.: (Sum_{k in Z} x^(k^2))^3.
a(8*n + 7) = 0. a(4*n) = a(n).
a(n) = A004015(2*n) = A014455(2*n) = A004013(4*n) = A169783(4*n). a(4*n + 1) = 6 * A045834(n). a(8*n + 3) = 8 * A008443(n). a(8*n + 5) = 24 * A045831(n). - Michael Somos, Jun 03 2012
a(4*n + 2) = 12 * A045828(n). - Michael Somos, Sep 03 2014
a(n) = (-1)^n * A213384(n). - Michael Somos, May 21 2015
a(n) = (6/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017
a(n) = A004018(n) + 2*Sum_{k=1..floor(sqrt(n))} A004018(n - k^2). - Daniel Suteu, Aug 27 2021
Convolution cube of A000122. Convolution of A004018 and A000122. - R. J. Mathar, Aug 03 2025

Extensions

More terms from James Sellers, Aug 22 2000

A058696 Number of ways to partition 2n into positive integers.

Original entry on oeis.org

1, 2, 5, 11, 22, 42, 77, 135, 231, 385, 627, 1002, 1575, 2436, 3718, 5604, 8349, 12310, 17977, 26015, 37338, 53174, 75175, 105558, 147273, 204226, 281589, 386155, 526823, 715220, 966467, 1300156, 1741630, 2323520, 3087735, 4087968, 5392783, 7089500, 9289091
Offset: 0

Views

Author

N. J. A. Sloane, Dec 31 2000

Keywords

Comments

A bisection of A000041, the other one is A058695.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700). - Michael Somos, Feb 16 2014
a(n) is the number of partitions of 3n-2 having n as a part, for n >= 1. Also, a(n+1) is the number of partitions of 3n having n as a part, for n >= 1. - Clark Kimberling, Mar 02 2014

Examples

			G.f. = 1 + 2*x + 5*x^2 + 11*x^3 + 22*x^4 + 42*x^5 + 77*x^6 + 135*x^7 + ...
G.f. = q^-1 + 2*q^47 + 5*q^95 + 11*q^143 + 22*q^191 + 42*q^239 + 77*q^287 + ...
		

Crossrefs

Programs

  • Maple
    a:= n-> combinat[numbpart](2*n):
    seq(a(n), n=0..42);  # Alois P. Heinz, Jan 29 2020
  • Mathematica
    nn=100;Table[CoefficientList[Series[Product[1/(1-x^i),{i,1,nn}],{x,0,nn}],x][[2i-1]],{i,1,nn/2}] (* Geoffrey Critzer, Sep 28 2013 *)
    (* also *)
    Table[PartitionsP[2 n], {n, 0, 40}] (* Clark Kimberling, Mar 02 2014 *)
    (* also *)
    Table[Count[IntegerPartitions[3 n - 2], p_ /; MemberQ[p, n]], {n, 20}]   (* Clark Kimberling, Mar 02 2014 *)
    nmax = 60; CoefficientList[Series[Product[(1 + x^(8*k-4))*(1 + x^(8*k))*(1 + x^k)^2/((1 + x^(8*k-1))*(1 + x^(8*k-7))*(1 - x^k)), {k, 1, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Nov 17 2016 *)
  • MuPAD
    combinat::partitions::count(2*i) $i=0..54 // Zerinvary Lajos, Apr 16 2007
  • PARI
    {a(n) = if( n<0, 0, polcoeff( 1 / eta(x + O(x^(2*n + 1))), 2*n))}; /* Michael Somos, Apr 25 2003 */
    
  • PARI
    a(n) = numbpart(2*n); \\ Michel Marcus, Sep 28 2013
    

Formula

Expansion of f(x^3, x^5) / f(-x)^2 in powers of x where f() is a Ramanujan theta function. - Michael Somos, Feb 16 2014
Euler transform of period 16 sequence [ 2, 2, 3, 2, 3, 1, 2, 1, 2, 1, 3, 2, 3, 2, 2, 1, ...]. - Michael Somos, Apr 25 2003
a(n) = A000041(2*n).
Convolution of A000041 and A035294. - Michael Somos, Feb 16 2014
G.f.: Product_{k>=1} (1 + x^(8*k-4)) * (1 + x^(8*k)) * (1 + x^k)^2 / ((1 + x^(8*k-1)) * (1 + x^(8*k-7)) * (1 - x^k)). - Vaclav Kotesovec, Nov 17 2016
a(n) ~ exp(2*Pi*sqrt(n/3)) / (8*sqrt(3)*n). - Vaclav Kotesovec, Feb 16 2022

A002448 Expansion of Jacobi theta function theta_4(x).

Original entry on oeis.org

1, -2, 0, 0, 2, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0
Offset: 0

Views

Author

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Number 2 of the 14 primitive eta-products which are holomorphic modular forms of weight 1/2 listed by D. Zagier on page 30 of "The 1-2-3 of Modular Forms". - Michael Somos, May 04 2016

Examples

			G.f. = 1 - 2*q + 2*q^4 - 2*q^9 + 2*q^16 - 2*q^25 + 2*q^36 - 2*q^49 + ...
		

References

  • Richard Bellman, A Brief Introduction to Theta Functions, Dover, 2013.
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 93, Eq. (34.11), p. 6, Eq. (7.324).
  • J. Tannery and J. Molk, Eléments de la Théorie des Fonctions Elliptiques, Vol. 2, Gauthier-Villars, Paris, 1902; Chelsea, NY, 1972, see p. 27.
  • E. T. Whittaker and G. N. Watson, A Course of Modern Analysis, Cambridge Univ. Press, 4th ed., 1963, p. 464.

Crossrefs

Programs

  • Julia
    using Nemo
    function JacobiTheta4(len, r)
        R, x = PolynomialRing(ZZ, "x")
        e = theta_qexp(r, len, -x)
        [fmpz(coeff(e, j)) for j in 0:len - 1] end
    A002448List(len) = JacobiTheta4(len, 1)
    A002448List(105) |> println # Peter Luschny, Mar 12 2018
    
  • Maple
    Sum((-x)^(m^2),m=-10..10);
  • Mathematica
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 4, 0, q], {q, 0, n}]; (* Michael Somos, Jul 11 2011 *)
    QP = QPochhammer; s = QP[q]^2/QP[q^2] + O[q]^105; CoefficientList[s, q] (* Jean-François Alcover, Dec 01 2015, adapted from PARI *)
  • PARI
    {a(n) = if( n<0, 0, (-1)^n * issquare(n) * 2 - (n==0))}; /* Michael Somos, Jun 17 1999 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x + A)^2 / eta(x^2 + A), n))}; /* Michael Somos, May 01 2003 */
    
  • Python
    from sympy.ntheory.primetest import is_square
    def A002448(n): return (-is_square(n) if n&1 else is_square(n))<<1 if n else 1 # Chai Wah Wu, May 17 2023

Formula

Expansion of phi(-q) in powers of q where phi() is a Ramanujan theta function.
Expansion of eta(q)^2 / eta(q^2) in powers of q. - Michael Somos, May 01 2003
Expansion of 2 * sqrt( k' * K / (2 Pi) ) in powers of q. - Michael Somos, Nov 30 2013
Euler transform of period 2 sequence [ -2, -1, ...]. - Michael Somos, May 01 2003
G.f.: Sum_{k in Z} (-1)^k * x^(k^2) = Product_{k>0} (1 - x^k) / (1 + x^k). - Michael Somos, May 01 2003.
G.f.: 1 - 2 Sum_{k>0} x^k/(1 - x^k) Product_{j=1..k} (1 - x^j) / (1 + x^j). - Michael Somos, Apr 12 2012
a(n) = -2 * b(n) where b(n) is multiplicative and b(2^e) = (-1)^(e/2) if e even, b(p^e) = 1 if p>2 and e even, otherwise 0. - Michael Somos, Jul 07 2006
a(3*n + 1) = -2 * A089802(n), a(9*n) = a(n). - Michael Somos, Jul 07 2006
a(3*n + 2) = a(4*n + 2) = a(4*n + 3) = 0. a(4*n) = A000122(n). a(n) = (-1)^n * A000122(n). a(8*n + 1) = -2 * A010054(n). - Michael Somos, Apr 12 2012
For n > 0, a(n) = 2*(floor(sqrt(n))-floor(sqrt(n-1)))*(-1)^(floor(sqrt(n))). - Mikael Aaltonen, Jan 17 2015
G.f. is a period 1 Fourier series which satisfies f(-1 / (16 t)) = 32^(1/2) (t/i)^(1/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A010054. - Michael Somos, May 05 2016
a(0) = 1, a(n) = -(2/n)*Sum_{k=1..n} A002131(k)*a(n-k) for n > 0. - Seiichi Manyama, Apr 29 2017
G.f.: exp(Sum_{k>=1} (sigma(k) - sigma(2*k))*x^k/k). - Ilya Gutkovskiy, Sep 19 2018
From Peter Bala, Feb 19 2021: (Start)
G.f: A(q) = eta(q^2)^5 / ( eta(-q)*eta(q^4) )^2.
A(q) = 1 + 2*Sum_{n >= 1} (-1)^n*q^(n*(n+1)/2)/( (1 + q^n) * Product_{k = 1..n} 1 - q^k ).
A(-q)^2 = 1 + 4*Sum_{n >= 1} (-1)^(n+1)*q^(2*n-1)/(1 - q^(2*n-1)), which gives the number of representations of an integer as a sum of two squares. See, for example, Fine, 26.63.
The unsigned sequence has the g.f. 1 + 2*Sum_{n >= 1} q^(n*(n+1)/2) * ( Product_{k = 1..n-1} 1 + q^k ) /( Product_{k = 1..n} 1 + q^(2*k) ) = 1 + 2*q + 2*q^4 + 2*q^9 + .... See Fine, equation 14.43. (End)
Form Peter Bala, Sep 27 2023: (Start)
G.f. A(q) satisfies A(q)*A(-q) = A(q^2)^2.
A(q) = Sum_{n >= 1} (-q)^(n-1)*Product_{k >= n} 1 - q^k. (End)

A008438 Sum of divisors of 2*n + 1.

Original entry on oeis.org

1, 4, 6, 8, 13, 12, 14, 24, 18, 20, 32, 24, 31, 40, 30, 32, 48, 48, 38, 56, 42, 44, 78, 48, 57, 72, 54, 72, 80, 60, 62, 104, 84, 68, 96, 72, 74, 124, 96, 80, 121, 84, 108, 120, 90, 112, 128, 120, 98, 156, 102, 104, 192, 108, 110, 152, 114, 144, 182, 144, 133, 168
Offset: 0

Views

Author

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Number of ways of writing n as the sum of 4 triangular numbers.
Bisection of A000203. - Omar E. Pol, Mar 14 2012
a(n) is also the total number of parts in all partitions of 2*n + 1 into equal parts. - Omar E. Pol, Feb 14 2021

Examples

			Divisors of 9 are 1,3,9, so a(4)=1+3+9=13.
F_2(z) = eta(4z)^8/eta(2z)^4 = q + 4q^3 + 6q^5 +8q^7 + 13q^9 + ...
G.f. = 1 + 4*x + 6*x^2 + 8*x^3 + 13*x^4 + 12*x^5 + 14*x^6 + 24*x^7 + 18*x^8 + 20*x^9 + ...
B(q) = q + 4*q^3 + 6*q^5 + 8*q^7 + 13*q^9 + 12*q^11 + 14*q^13 + 24*q^15 + 18*q^17 + ...
		

References

  • B. C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag, see p. 139 Ex. (iii).
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 19 eq. (6), and p. 283 eq. (8).
  • W. Dunham, Euler: The Master of Us All, The Mathematical Association of America Inc., Washington, D.C., 1999, p. 12.
  • H. M. Farkas, I. Kra, Cosines and triangular numbers, Rev. Roumaine Math. Pures Appl., 46 (2001), 37-43.
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 79, Eq. (32.31).
  • N. Koblitz, Introduction to Elliptic Curves and Modular Forms, Springer-Verlag, 1984, see p. 184, Prop. 4, F(z).
  • G. Polya, Induction and Analogy in Mathematics, vol. 1 of Mathematics and Plausible Reasoning, Princeton Univ. Press, 1954, page 92 ff.

Crossrefs

Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809.

Programs

  • Haskell
    a008438 = a000203 . a005408  -- Reinhard Zumkeller, Sep 22 2014
    
  • Magma
    Basis( ModularForms( Gamma0(4), 2), 124) [2]; /* Michael Somos, Jun 12 2014 */
    
  • Magma
    [DivisorSigma(1, 2*n+1): n in [0..70]]; // Vincenzo Librandi, Aug 01 2017
  • Maple
    A008438 := proc(n) numtheory[sigma](2*n+1) ; end proc: # R. J. Mathar, Mar 23 2011
  • Mathematica
    DivisorSigma[1, 2 # + 1] & /@ Range[0, 61] (* Ant King, Dec 02 2010 *)
    a[ n_] := SeriesCoefficient[ D[ Series[ Log[ QPochhammer[ -x] / QPochhammer[ x]], {x, 0, 2 n + 1}], x], {x, 0 , 2n}]; (* Michael Somos, Oct 15 2019 *)
  • PARI
    {a(n) = if( n<0, 0, sigma( 2*n + 1))};
    
  • PARI
    {a(n) = if( n<0, 0, n = 2*n; polcoeff( sum( k=1, (sqrtint( 4*n + 1) + 1)\2, x^(k^2 - k), x * O(x^n))^4, n))}; /* Michael Somos, Sep 17 2004 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, n = 2*n; A = x * O(x^n); polcoeff( (eta(x^4 + A)^2 / eta(x^2 + A))^4, n))}; /* Michael Somos, Sep 17 2004 */
    
  • Sage
    ModularForms( Gamma0(4), 2, prec=124).1;  # Michael Somos, Jun 12 2014
    

Formula

Expansion of q^(-1/2) * (eta(q^2)^2 / eta(q))^4 = psi(q)^4 in powers of q where psi() is a Ramanujan theta function. - Michael Somos, Apr 11 2004
Expansion of Jacobi theta_2(q)^4 / (16*q) in powers of q^2. - Michael Somos, Apr 11 2004
Euler transform of period 2 sequence [4, -4, 4, -4, ...]. - Michael Somos, Apr 11 2004
a(n) = b(2*n + 1) where b() is multiplicative and b(2^e) = 0^n, b(p^e) =(p^(e+1) - 1) / (p - 1) if p>2. - Michael Somos, Jul 07 2004
Given g.f. A(x), then B(q) = q * A(q^2) satisfies 0 = f(B(q), B(q^2), B(q^4)) where f(u, v, w) = v^3 + 8*w*v^2 + 16*w^2*v - u^2*w - Michael Somos, Apr 08 2005
Given g.f. A(x), then B(q) = q * A(q^2) satisfies 0 = f(B(q), B(q^3), B(q^9)) where f(u, v, w) = v^4 - 30*u*v^2*w + 12*u*v*w*(u + 9*w) - u*w*(u^2 + 9*w*u + 81*w^2).
Given g.f. A(x), then B(q) = q * A(q^2) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u2^3 + u1^2*u6 + 3*u2*u3^2 + 27*u6^3 - u1*u2*u3 - 3*u1*u3*u6 - 7*u2^2*u6 - 21*u2*u6^2. - Michael Somos, May 30 2005
G.f.: Sum_{k>=0} (2k + 1) * x^k / (1 - x^(2k + 1)).
G.f.: (Product_{k>0} (1 - x^k) * (1 + x^k)^2)^4. - Michael Somos, Apr 11 2004
G.f. Sum_{k>=0} a(k) * x^(2*k + 1) = x * (Product_{k>0} (1 - x^(4*k))^2 / (1 - x^(2*k)))^4 = x * (Sum_{k>0} x^(k^2 - k))^4 = Sum_{k>0} k * (x^k / (1 - x^k) - 3 * x^(2*k) / (1 - x^(2*k)) + 2 * x^(4*k) / (1 - x^(4*k))). - Michael Somos, Jul 07 2004
Number of solutions of 2*n + 1 = (x^2 + y^2 + z^2 + w^2) / 4 in positive odd integers. - Michael Somos, Apr 11 2004
8 * a(n) = A005879(n) = A000118(2*n + 1). 16 * a(n) = A129588(n). a(n) = A000593(2*n + 1) = A115607(2*n + 1).
a(n) = A000203(2*n+1). - Omar E. Pol, Mar 14 2012
G.f. is a period 1 Fourier series which satisfies f(-1 / (4 t)) = (1/4) (t/i)^2 g(t) where q = exp(2 Pi i t) and g() is the g.f. for A096727. Michael Somos, Jun 12 2014
a(0) = 1, a(n) = (4/n)*Sum_{k=1..n} A002129(k)*a(n-k) for n > 0. - Seiichi Manyama, May 06 2017
G.f.: exp(Sum_{k>=1} 4*(x^k/k)/(1 + x^k)). - Ilya Gutkovskiy, Jul 31 2017
From Peter Bala, Jan 10 2021: (Start)
a(n) = A002131(2*n+1).
G.f.: Sum_{n >= 0} x^n*(1 + x^(2*n+1))/(1 - x^(2*n+1))^2. (End)
Sum_{k=1..n} a(k) ~ Pi^2 * n^2 / 8. - Vaclav Kotesovec, Aug 07 2022
Convolution of A125061 and A138741. - Michael Somos, Mar 04 2023

Extensions

Comments from Len Smiley, Enoch Haga

A030203 Expansion of q^(-1/6) * eta(q) * eta(q^3) in powers of q.

Original entry on oeis.org

1, -1, -1, -1, 1, 2, -1, 2, 0, 0, -1, -1, -1, -1, 0, 1, -1, -1, 2, 0, 1, 2, 1, -1, 0, -1, 2, -1, 0, -1, -1, 0, -1, -1, 0, -1, -2, 2, 2, 0, -1, 1, 0, 1, 0, -1, 2, 2, 1, 0, -2, 2, -1, 0, -1, -1, -1, 1, -1, 0, 0, -1, -1, -1, 0, 0, 2, -2, -1, 0, -1, 1, 2, 2, 0, 0
Offset: 0

Views

Author

Keywords

Comments

Number 65 of the 74 eta-quotients listed in Table I of Martin (1996).
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Cubic AGM theta functions: a(q) (see A004016), b(q) (A005928), c(q) (A005882).

Examples

			G.f. = 1 - x - x^2 - x^3 + x^4 + 2*x^5 - x^6 + 2*x^7 - x^10 - x^11 - x^12 - x^13 + ...
G.f. = q - q^7 - q^13 - q^19 + q^25 + 2*q^31 - q^37 + 2*q^43 - q^61 - q^67 - ...
		

Programs

  • Magma
    Basis( CuspForms( Gamma1(108), 1), 452)[1]; /* Michael Somos, Jan 31 2015 */
  • Mathematica
    a[ n_] := SeriesCoefficient[ QPochhammer[ x] QPochhammer[ x^3], {x, 0, n}]; (* Michael Somos, Jan 31 2015 *)
  • PARI
    {a(n) = my(A, p, e); if( n<0, 0, n = 6*n + 1; A = factor(n); prod( k=1, matsize(A)[1], [p, e] = A[k,]; if( p<5, 0, p%6==5, (1 + (-1)^e) / 2, (p-1) / znorder( Mod(2, p))%3, kronecker( e+1, 3), e+1)))}; /* Michael Somos, Jul 27 2006 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x + A) * eta(x^3 + A), n))}; /* Michael Somos, Jul 27 2006 */
    

Formula

Expansion of f(-x) * f(-x^3) where f(-x) := f(-x, -x^2) is a Ramanujan theta function. - Michael Somos, Jul 27 2006
Expansion of q^(-1/6) * sqrt(b(q) * c(q)/3) in powers of q where b(), c() are cubic AGM theta functions. - Michael Somos, Nov 01 2006
Euler transform of period 3 sequence [ -1, -1, -2, ...]. - Michael Somos, Jul 27 2006
Given g.f. A(x), then B(q) = (q * A(q^6))^2 satisfies 0 = f(B(q), B(q^2), B(q^4)) where f(u, v, w) = v^3 - u^2*w - 4*u*w^2. - Michael Somos, Jul 27 2006
a(n) = b(6*n + 1) where b(n) is multiplicative and b(2^e) = b(3^e) = 0^e, b(p^e) = (1+(-1)^e)/2 if p == 5 (mod 6), b(p^e) = e+1 if p = x^2 + 27*y^2, b(p^e) = [1, -1, 0] depending on e (mod 3) otherwise.
G.f. is a period 1 Fourier series which satisfies f(-1 / (108 t)) = 108^(1/2) (t/i) f(t) where q = exp(2 Pi i t). - Michael Somos, Jan 22 2012
G.f.: Product_{k>0} (1 - x^k) * (1 - x^(3*k)).

A001935 Number of partitions with no even part repeated; partitions of n in which no parts are multiples of 4.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 9, 12, 16, 22, 29, 38, 50, 64, 82, 105, 132, 166, 208, 258, 320, 395, 484, 592, 722, 876, 1060, 1280, 1539, 1846, 2210, 2636, 3138, 3728, 4416, 5222, 6163, 7256, 8528, 10006, 11716, 13696, 15986, 18624, 21666, 25169, 29190, 33808, 39104, 45164
Offset: 0

Views

Author

Keywords

Comments

Also number of partitions of n where no part appears more than three times.
a(n) satisfies Euler's pentagonal number (A001318) theorem, unless n is in A062717 (see Fink et al.).
Also number of partitions of n in which the least part and the differences between consecutive parts is at most 3. Example: a(5)=6 because we have [4,1], [3,2], [3,1,1], [2,2,1], [2,1,1,1] and [1,1,1,1,1]. - Emeric Deutsch, Apr 19 2006
Equals A000009 convolved with its aerated variant, = polcoeff A000009 * A000041 * A010054 (with alternate signs). - Gary W. Adamson, Mar 16 2010
Equals left border of triangle A174715. - Gary W. Adamson, Mar 27 2010
The Cayley reference is actually to A083365. - Michael Somos, Feb 24 2011
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Convolution of A000009 and A035457. - Vaclav Kotesovec, Aug 23 2015
Convolution inverse is A082303. - Michael Somos, Sep 30 2017
The g.f. in the form Sum_{n >= 0} x^(n*(n+1)/2) * Product_{k = 1..n} (1+x^k)/(1-x^k) = Sum_{n >= 0} x^(n*(n+1)/2) * Product_{k = 1..n} (1+x^k)/(1+x^k-2*x^k) == Sum_{n >= 0} x^(n*(n+1)/2) (mod 2). It follows that a(n) is odd iff n = k*(k + 1)/2 for some nonnegative integer k. Cf. A333374. - Peter Bala, Jan 08 2025

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 4*x^4 + 6*x^5 + 9*x^6 + 12*x^7 + 16*x^8 + 22*x^9 + ...
G.f. = q + q^9 + 2*q^17 + 3*q^25 + 4*q^33 + 6*q^41 + 9*q^49 + 12*q^57 + 16*q^65 + 22*q^73 + ...
a(5)=6 because we have [5], [4,1], [3,2], [3,1,1], [2,1,1,1] and [1,1,1,1,1].
		

References

  • A. Cayley, A memoir on the transformation of elliptic functions, Collected Mathematical Papers. Vols. 1-13, Cambridge Univ. Press, London, 1889-1897, Vol. 9, p. 128.
  • I. P. Goulden and D. M. Jackson, Combinatorial Enumeration, Wiley, N.Y., 1983, (2.5.2).
  • M. D. Hirschhorn, The Power of q, Springer, 2017. See ped page 303ff.
  • R. Honsberger, Mathematical Gems III, M.A.A., 1985, p. 241.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000041, A010054. - Gary W. Adamson, Mar 16 2010
Cf. A174715. - Gary W. Adamson, Mar 27 2010
Cf. A082303.
Number of r-regular partitions for r = 2 through 12: A000009, A000726, A001935, A035959, A219601, A035985, A261775, A104502, A261776, A328545, A328546.

Programs

  • Haskell
    a001935 = p a042968_list where
       p _          0 = 1
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Sep 02 2012
  • Maple
    g:=product((1+x^j)*(1+x^(2*j)),j=1..50): gser:=series(g,x=0,55): seq(coeff(gser,x,n),n=0..48); # Emeric Deutsch, Apr 19 2006
    # second Maple program:
    with(numtheory):
    a:= proc(n) option remember; `if`(n=0, 1, add(a(n-j)*add(
         `if`(irem(d, 4)=0, 0, d), d=divisors(j)), j=1..n)/n)
        end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Nov 24 2015
  • Mathematica
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, 0, q] / EllipticTheta[ 2, Pi/4, q^(1/2)] / (16 q)^(1/8), {q, 0, n}]; (* Michael Somos, Jul 11 2011 *)
    a[ n_] := SeriesCoefficient[ Product[ 1 - x^k, {k, 4, n, 4}] / Product[ 1 - x^k, {k, n}], {x, 0, n}]; (* Michael Somos, Jul 08 2011 *)
    CoefficientList[Series[Product[1+x^j+x^(2j)+x^(3j), {j,1,48}], {x,0,48}],x] (* Jean-François Alcover, May 26 2011, after Jon Perry *)
    QP = QPochhammer; CoefficientList[QP[q^4]/QP[q] + O[q]^50, q] (* Jean-François Alcover, Nov 24 2015 *)
    a[0] = 1; a[n_] := a[n] = Sum[a[n-j] DivisorSum[j, If[Divisible[#, 4], 0, #]&], {j, 1, n}]/n; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Feb 19 2016, after Alois P. Heinz *)
    Table[Count[IntegerPartitions@n, x_ /; ! MemberQ [Mod[x, 4], 0, 2] ], {n, 0, 49}] (* Robert Price, Jul 28 2020 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( eta(x^4 + x * O(x^n)) / eta(x + x * O(x^n)), n))};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum(k=0, (sqrtint( 8*n + 1) - 1)\2, prod(i=1, k, (1 + x^i) / (x^-i - 1), 1 + x * O(x^n))), n))}; /* Michael Somos, Jun 01 2004 */
    
  • PARI
    {a(n)=polcoeff(exp(sum(m=1, n+1, x^m/(1+(-x)^m+x*O(x^n))/m)),n)} \\ Paul D. Hanna, Jul 24 2013
    

Formula

Euler transform of period 4 sequence [ 1, 1, 1, 0, ...].
Expansion of q^(-1/8) * eta(q^4) / eta(q) in powers of q. - Michael Somos, Mar 19 2004
Expansion of psi(-x) / phi(-x) = psi(x) / phi(-x^2) = psi(x^2) / psi(-x) = chi(x) / chi(-x^2)^2 = 1 / (chi(x) * chi(-x)^2) = 1 / (chi(-x) * chi(-x^2)) = f(-x^4) / f(-x) in powers of x where phi(), psi(), chi(), f() are Ramanujan theta functions. - Michael Somos, Jul 08 2011
G.f.: Product(j>=1, 1 + x^j + x^(2*j) + x^(3*j)). - Jon Perry, Mar 30 2004
G.f.: Product_{k>=1} (1+x^k)^(2-k%2). - Jon Perry, May 05 2005
G.f.: Product_{k>0} (1 + x^(2*k)) / (1 - x^(2*k-1)) = 1 + Sum_{k>0}(Product_{i=1..k} (x^i + 1) / (x^-i - 1)).
G.f.: Sum_{n>=0} ( x^(n*(n+1)/2) * Product_{k=1..n} (1+x^k)/(1-x^k) ). - Joerg Arndt, Apr 07 2011
G.f.: P(x^4)/P(x) where P(x) = Product_{k>=1} 1-x^k. - Joerg Arndt, Jun 21 2011
A083365(n) = (-1)^n a(n). Convolution square is A001936. a(n) = A098491(n) + A098492(n). a(2*n) = A081055(n). a(2*n + 1) = A081056(n).
G.f.: (1+ 1/G(0))/2, where G(k) = 1 - x^(2*k+1) - x^(2*k+1)/(1 + x^(2*k+2) + x^(2*k+2)/G(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jul 03 2013
G.f.: exp( Sum_{n>=1} (x^n/n) / (1 + (-x)^n) ). - Paul D. Hanna, Jul 24 2013
a(n) ~ Pi * BesselI(1, sqrt(8*n + 1)*Pi/4) / (2*sqrt(8*n + 1)) ~ exp(Pi*sqrt(n/2)) / (4 * (2*n)^(3/4)) * (1 + (Pi/(16*sqrt(2)) - 3/(4*Pi*sqrt(2))) / sqrt(n) + (Pi^2/1024 - 15/(64*Pi^2) - 15/128) / n). - Vaclav Kotesovec, Aug 23 2015, extended Jan 14 2017
a(n) = (1/n)*Sum_{k=1..n} A046897(k)*a(n-k), a(0) = 1. - Seiichi Manyama, Mar 25 2017
G.f. is a period 1 Fourier series which satisfies f(-1 / (256 t)) = 1/2 g(t) where q = exp(2 Pi i t) and g() is the g.f. for A082303. - Michael Somos, Sep 30 2017

Extensions

More terms from James Sellers

A006950 G.f.: Product_{k>=1} (1 + x^(2*k - 1)) / (1 - x^(2*k)).

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 5, 7, 10, 13, 16, 21, 28, 35, 43, 55, 70, 86, 105, 130, 161, 196, 236, 287, 350, 420, 501, 602, 722, 858, 1016, 1206, 1431, 1687, 1981, 2331, 2741, 3206, 3740, 4368, 5096, 5922, 6868, 7967, 9233, 10670, 12306, 14193, 16357, 18803, 21581
Offset: 0

Views

Author

Keywords

Comments

Also the number of partitions of n in which all odd parts are distinct. There is no restriction on the even parts. E.g., a(9)=13 because "9 = 8+1 = 7+2 = 6+3 = 6+2+1 = 5+4 = 5+3+1 = 5+2+2 = 4+4+1 = 4+3+2 = 4+2+2+1 = 3+2+2+2 = 2+2+2+2+1". - Noureddine Chair, Feb 03 2005
Number of partitions of n in which each even part occurs with even multiplicity. There is no restriction on the odd parts.
Also the number of partitions of n into parts not congruent to 2 mod 4. - James Sellers, Feb 08 2002
Coincides with the sequence of numbers of nilpotent conjugacy classes in the Lie algebras o(n) of skew-symmetric n X n matrices, n=0,1,2,3,... (the cases n=0,1 being degenerate). This sequence, A015128 and A000041 together cover the nilpotent conjugacy classes in the classical A,B,C,D series of Lie algebras. - Alexander Elashvili, Sep 08 2003
Poincaré series [or Poincare series] (or Molien series) for symmetric invariants in F_2(b_1, b_2, ... b_n) ⊗ E(e_1, e_2, ... e_n) with b_i 2-dimensional, e_i one-dimensional and the permutation action of S_n, in the case n=2.
Equals polcoeff inverse of A010054 with alternate signs. - Gary W. Adamson, Mar 15 2010
It appears that this sequence is related to the generalized hexagonal numbers (A000217) in the same way as the partition numbers A000041 are related to the generalized pentagonal numbers A001318. (See the table in comments section of A195825.) Conjecture: this is 1 together with the row sums of triangle A195836, also column 1 of A195836, also column 2 of the square array A195825. - Omar E. Pol, Oct 09 2011
Since this is also column 2 of A195825 so the sequence contains only one plateau [1, 1, 1] of level 1 and length 3. For more information see A210843. - Omar E. Pol, Jun 27 2012
Convolution of A035363 and A000700. - Vaclav Kotesovec, Aug 17 2015
Also the number of ways to stack n triangles in a valley (pointing upwards or downwards depending on row parity). - Seiichi Manyama, Jul 07 2018

Examples

			G.f. = 1 + x + x^2 + 2*x^3 + 3*x^4 + 4*x^5 + 5*x^6 + 7*x^7 + 10*x^8 + 13*x^9 + ...
G.f. = q^-1 + q^7 + q^15 + 2*q^23 + 3*q^31 + 4*q^39 + 5*q^47 + 7*q^55 + 10*q^63 + ...
From _Seiichi Manyama_, Jul 07 2018: (Start)
n | the ways to stack n triangles in a valley
--+------------------------------------------------------
1 | *---*
  |  \ /
  |   *
  |
2 |   *
  |  / \
  | *---*
  |  \ /
  |   *
  |
3 |   *---*     *---*
  |  / \ /       \ / \
  | *---*         *---*
  |  \ /           \ /
  |   *             *
  |
4 |     *                       *
  |    / \                     / \
  |   *---*     *---*---*     *---*
  |  / \ /       \ / \ /       \ / \
  | *---*         *---*         *---*
  |  \ /           \ /           \ /
  |   *             *             *
  |
5 |     *---*         *         *         *---*
  |    / \ /         / \       / \         \ / \
  |   *---*     *---*---*     *---*---*     *---*
  |  / \ /       \ / \ /       \ / \ /       \ / \
  | *---*         *---*         *---*         *---*
  |  \ /           \ /           \ /           \ /
  |   *             *             *             *
  |
6 |       *
  |      / \
  |     *---*         *---*     *   *     *---*
  |    / \ /         / \ /     / \ / \     \ / \
  |   *---*     *---*---*     *---*---*     *---*---*
  |  / \ /       \ / \ /       \ / \ /       \ / \ /
  | *---*         *---*         *---*         *---*
  |  \ /           \ /           \ /           \ /
  |   *             *             *             *
  |   *
  |  / \
  | *---*
  |  \ / \
  |   *---*
  |    \ / \
  |     *---*
  |      \ /
  |       *
(End)
		

References

  • A. Adem and R. J. Milgram, Cohomology of Finite Groups, Springer-Verlag, 2nd. ed., 2004; p. 108.
  • M. D. Hirschhorn, The Power of q, Springer, 2017. See pod, page 297.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See also Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Cf. A163203.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-1)+`if`(i>n, 0, b(n-i, i-irem(i, 2)))))
        end:
    a:= n-> b(n, n):
    seq(a(n), n=0..50);  # Alois P. Heinz, Jan 06 2013
  • Mathematica
    CoefficientList[ Series[ Product[(1 + x^(2k - 1))/(1 - x^(2k)), {k, 25}], {x, 0, 50}], x] (* Robert G. Wilson v, Jun 28 2012 *)
    CoefficientList[Series[x*QPochhammer[-1/x, x^2] / ((1+x)*QPochhammer[x^2, x^2]), {x, 0, 50}], x] (* Vaclav Kotesovec, Aug 17 2015 *)
    CoefficientList[Series[2*(-x)^(1/8) / EllipticTheta[2, 0, Sqrt[-x]], {x, 0, 50}], x] (* Vaclav Kotesovec, Aug 17 2015 *)
    b[n_, i_] := b[n, i] = If[n==0, 1, If[i<1, 0, b[n, i-1] + If[i>n, 0, b[n-i, i-Mod[i, 2]]]]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Dec 11 2018, after Alois P. Heinz *)
  • PARI
    {a(n)=polcoeff(exp(sum(m=1, n+1, sumdiv(m, d, (-1)^(m-d)*d)*x^m/m)+x*O(x^n)), n)} \\ Paul D. Hanna, Jul 22 2009
    (GW-BASIC)
    ' A program with two A-numbers (Note that here A000217 are the generalized hexagonal numbers):
    10 Dim A000217(100), A057077(100), a(100): a(0)=1
    20 For n = 1 to 51: For j = 1 to n
    30 If A000217(j) <= n then a(n) = a(n) + A057077(j-1)*a(n - A000217(j))
    40 Next j: Print a(n-1);: Next n ' Omar E. Pol, Jun 10 2012

Formula

a(n) = (1/n)*Sum_{k=1..n} (-1)^(k+1)*A002129(k)*a(n-k), n > 1, a(0)=1. - Vladeta Jovovic, Feb 05 2002
G.f.: 1/Sum_{k>=0} (-x)^(k*(k+1)/2). - Vladeta Jovovic, Sep 22 2002 [corrected by Vaclav Kotesovec, Aug 17 2015]
a(n) = A059777(n-1)+A059777(n), n > 0. - Vladeta Jovovic, Sep 22 2002
G.f.: Product_{m>=1} (1+x^m)^(if A001511(m) > 1, A001511(m)-1 else A001511(m)). - Jon Perry, Apr 15 2005
Expansion of 1 / psi(-x) in powers of x where psi() is a Ramanujan theta function.
Expansion of q^(1/8) * eta(q^2) / (eta(q) * eta(q^4)) in powers of q.
Convolution inverse of A106459. - Michael Somos, Nov 02 2005
G.f.: exp( Sum_{n>=1} [Sum_{d|n} (-1)^(n-d)*d] * x^n/n ). - Paul D. Hanna, Jul 22 2009
a(n) ~ (8*n+1) * cosh(sqrt(8*n-1)*Pi/4) / (16*sqrt(2)*n^2) - sinh(sqrt(8*n-1)*Pi/4) / (2*Pi*n^(3/2)) ~ exp(Pi*sqrt(n/2))/(4*sqrt(2)*n) * (1 - (2/Pi + Pi/16)/sqrt(2*n) + (3/16 + Pi^2/1024)/n). - Vaclav Kotesovec, Aug 17 2015, extended Jan 09 2017
Can be computed recursively by Sum_{j>=0} (-1)^(ceiling(j/2)) a(n - j(j+1)/2) = 0, for n > 0. [Merca, Theorem 4.3] - Eric M. Schmidt, Sep 21 2017
a(n) = A000041(n) - A085642(n), for n >= 1. - Wouter Meeussen, Dec 20 2017

Extensions

G.f. and more terms from Vladeta Jovovic, Feb 05 2002

A008441 Number of ways of writing n as the sum of 2 triangular numbers.

Original entry on oeis.org

1, 2, 1, 2, 2, 0, 3, 2, 0, 2, 2, 2, 1, 2, 0, 2, 4, 0, 2, 0, 1, 4, 2, 0, 2, 2, 0, 2, 2, 2, 1, 4, 0, 0, 2, 0, 4, 2, 2, 2, 0, 0, 3, 2, 0, 2, 4, 0, 2, 2, 0, 4, 0, 0, 0, 4, 3, 2, 2, 0, 2, 2, 0, 0, 2, 2, 4, 2, 0, 2, 2, 0, 3, 2, 0, 0, 4, 0, 2, 2, 0, 6, 0, 2, 2, 0, 0, 2, 2, 0, 1, 4, 2, 2, 4, 0, 0, 2, 0, 2, 2, 2, 2, 0, 0
Offset: 0

Views

Author

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700). The present sequence gives the expansion coefficients of psi(q)^2.
Also the number of positive odd solutions to equation x^2 + y^2 = 8*n + 2. - Seiichi Manyama, May 28 2017

Examples

			G.f. = 1 + 2*x + x^2 + 2*x^3 + 2*x^4 + 3*x^6 + 2*x^7 + 2*x^9 + 2*x^10 + 2*x^11 + ...
G.f. for B(q) = q * A(q^4) = q + 2*q^5 + q^9 + 2*q^13 + 2*q^17 + 3*q^25 + 2*q^29 + 2*q^37 + 2*q^41 + ...
		

References

  • B. C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag. See p. 139 Example (iv).
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
  • R. W. Gosper, Strip Mining in the Abandoned Orefields of Nineteenth Century Mathematics, in Computers in Mathematics (Ed. D. V. Chudnovsky and R. D. Jenks). New York: Dekker, 1990. See p. 279.
  • R. W. Gosper, Experiments and discoveries in q-trigonometry, in Symbolic Computation, Number Theory, Special Functions, Physics and Combinatorics. Editors: F. G. Garvan and M. E. H. Ismail. Kluwer, Dordrecht, Netherlands, 2001, pp. 79-105. [See Pi_q.]
  • P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916. See vol. 2, p 31, Article 272.
  • Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, An Introduction to the Theory Of Numbers, Fifth Edition, John Wiley and Sons, Inc., NY 1991, p. 165.

Crossrefs

Cf. A004020, A005883, A104794, A052343, A199015 (partial sums).
Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809.
Cf. A274621 (reciprocal series).

Programs

  • Haskell
    a052343 = (flip div 2) . (+ 1) . a008441
    -- Reinhard Zumkeller, Jul 25 2014
    
  • Magma
    A := Basis( ModularForms( Gamma1(8), 1), 420); A[2]; /* Michael Somos, Jan 31 2015 */
  • Maple
    sigmamr := proc(n,m,r) local a,d ; a := 0 ; for d in numtheory[divisors](n) do if modp(d,m) = r then a := a+1 ; end if; end do: a; end proc:
    A002654 := proc(n) sigmamr(n,4,1)-sigmamr(n,4,3) ; end proc:
    A008441 := proc(n) A002654(4*n+1) ; end proc:
    seq(A008441(n),n=0..90) ; # R. J. Mathar, Mar 23 2011
  • Mathematica
    Plus@@((-1)^(1/2 (Divisors[4#+1]-1)))& /@ Range[0, 104] (* Ant King, Dec 02 2010 *)
    a[ n_] := SeriesCoefficient[ (1/2) EllipticTheta[ 2, 0, q] EllipticTheta[ 3, 0, q], {q, 0, n + 1/4}]; (* Michael Somos, Jun 19 2012 *)
    a[ n_] := SeriesCoefficient[ (1/4) EllipticTheta[ 2, 0, q]^2, {q, 0, 2 n + 1/2}]; (* Michael Somos, Jun 19 2012 *)
    a[ n_] := If[ n < 0, 0, DivisorSum[ 4 n + 1, (-1)^Quotient[#, 2] &]];  (* Michael Somos, Jun 08 2014 *)
    QP = QPochhammer; s = QP[q^2]^4/QP[q]^2 + O[q]^100; CoefficientList[s, q] (* Jean-François Alcover, Nov 27 2015, adapted from PARI *)
    TriangleQ[n_] := IntegerQ@Sqrt[8n +1]; Table[Count[FrobeniusSolve[{1, 1}, n], {?TriangleQ}], {n, 0, 104}] (* Robert G. Wilson v, Apr 15 2017 *)
  • PARI
    {a(n) = if( n<1, n==0, polcoeff( sum(k=0, (sqrtint(8*n + 1) - 1)\2, x^(k * (k+1)/2), x * O(x^n))^2, n) )};
    
  • PARI
    {a(n) = if( n<0, 0, n = 4*n + 1; sumdiv(n, d, (-1)^(d\2)))}; /* Michael Somos, Sep 02 2005 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^4 / eta(x + A)^2, n))};
    
  • PARI
    {a(n) = if( n<0, 0, n = 4*n + 1; sumdiv( n, d, (d%4==1) - (d%4==3)))}; /* Michael Somos, Sep 14 2005 */
    
  • PARI
    { my(q='q+O('q^166)); Vec(eta(q^2)^4 / eta(q)^2) } \\ Joerg Arndt, Apr 16 2017
    
  • Sage
    ModularForms( Gamma1(8), 1, prec=420).1; # Michael Somos, Jun 08 2014
    

Formula

This sequence is the quadrisection of many sequences. Here are two examples:
a(n) = A002654(4n+1), the difference between the number of divisors of 4*n+1 of form 4*k+1 and the number of form 4*k-1. - David Broadhurst, Oct 20 2002
a(n) = b(4*n + 1), where b(n) is multiplicative and b(2^e) = 0^e, b(p^e) = (1 + (-1)^e) / 2 if p == 3 (mod 4), b(p^e) = e+1 if p == 1 (mod 4). - Michael Somos, Sep 14 2005
G.f.: (Sum_{k>=0} x^((k^2 + k)/2))^2 = (Sum_{k>=0} x^(k^2 + k)) * (Sum_{k in Z} x^(k^2)).
Expansion of Jacobi theta (theta_2(0, sqrt(q)))^2 / (4 * q^(1/4)).
Sum[d|(4n+1), (-1)^((d-1)/2) ].
Given g.f. A(x), then B(q) = q * A(q^4) satisfies 0 = f(B(q), B(q^2), B(q^4)) where f(u, v, w) = v^3 + 4 * v * w^2 - u^2 * w. - Michael Somos, Sep 14 2005
Given g.f. A(x), then B(q) = q * A(q^4) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u1 * u3 - (u2 - u6) * (u2 + 3*u6). - Michael Somos, Sep 14 2005
Expansion of Jacobi k/(4*q^(1/2)) * (2/Pi)* K(k) in powers of q^2. - Michael Somos, Sep 14 2005. Convolution of A001938 and A004018. This appears in the denominator of the Jacobi sn and cn formula given in the Abramowitz-Stegun reference, p. 575, 16.23.1 and 16.23.2, where m=k^2. - Wolfdieter Lang, Jul 05 2016
G.f.: Sum_{k>=0} a(k) * x^(2*k) = Sum_{k>=0} x^k / (1 + x^(2*k + 1)).
G.f.: Sum_{k in Z} x^k / (1 - x^(4*k + 1)). - Michael Somos, Nov 03 2005
Expansion of psi(x)^2 = phi(x) * psi(x^2) in powers of x where phi(), psi() are Ramanujan theta functions.
Moebius transform is period 8 sequence [ 1, -1, -1, 0, 1, 1, -1, 0, ...]. - Michael Somos, Jan 25 2008
G.f. is a period 1 Fourier series which satisfies f(-1 / (8 t)) = 1/2 (t/i) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A104794.
Euler transform of period 2 sequence [ 2, -2, ...].
G.f.: q^(-1/4) * eta(q^2)^4 / eta(q)^2. See also the Fine reference.
a(n) = Sum_{k=0..n} A010054(k)*A010054(n-k). - Reinhard Zumkeller, Nov 03 2009
A004020(n) = 2 * a(n). A005883(n) = 4 * a(n).
Convolution square of A010054.
G.f.: Product_{k>0} (1 - x^(2*k))^2 / (1 - x^(2*k-1))^2.
a(2*n) = A113407(n). a(2*n + 1) = A053692(n). a(3*n) = A002175(n). a(3*n + 1) = 2 * A121444(n). a(9*n + 2) = a(n). a(9*n + 5) = a(9*n + 8) = 0. - Michael Somos, Jun 08 2014
G.f.: exp( Sum_{n>=1} 2*(x^n/n) / (1 + x^n) ). - Paul D. Hanna, Mar 01 2016
a(n) = A001826(2+8*n) - A001842(2+8*n), the difference between the number of divisors 1 (mod 4) and 3 (mod 4) of 2+8*n. See the Ono et al. link, Corollary 1, or directly the Niven et al. reference, p. 165, Corollary (3.23). - Wolfdieter Lang, Jan 11 2017
Expansion of continued fraction 1 / (1 - x^1 + x^1*(1 - x^1)^2 / (1 - x^3 + x^2*(1 - x^2)^2 / (1 - x^5 + x^3*(1 - x^3)^2 / ...))) in powers of x^2. - Michael Somos, Apr 20 2017
Given g.f. A(x), and B(x) is the g.f. for A079006, then B(x) = A(x^2) / A(x) and B(x) * B(x^2) * B(x^4) * ... = 1 / A(x). - Michael Somos, Apr 20 2017
a(0) = 1, a(n) = (2/n)*Sum_{k=1..n} A002129(k)*a(n-k) for n > 0. - Seiichi Manyama, May 06 2017
From Paul D. Hanna, Aug 10 2019: (Start)
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} binomial(n,k) * (x^(2*n+1) - x^(2*k))^(n-k) = Sum_{n>=0} a(n)*x^(2*n).
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} binomial(n,k) * (x^(2*n+1) + x^(2*k))^(n-k) * (-1)^k = Sum_{n>=0} a(n)*x^(2*n). (End)
From Peter Bala, Jan 05 2021: (Start)
G.f.: Sum_{n = -oo..oo} x^(4*n^2+2*n) * (1 + x^(4*n+1))/(1 - x^(4*n+1)). See Agarwal, p. 285, equation 6.20 with i = j = 1 and mu = 4.
For prime p of the form 4*k + 3, a(n*p^2 + (p^2 - 1)/4) = a(n).
If n > 0 and p are coprime then a(n*p + (p^2 - 1)/4) = 0. The proofs are similar to those given for the corresponding results for A115110. Cf. A000729.
For prime p of the form 4*k + 1 and for n not congruent to (p - 1)/4 (mod p) we have a(n*p^2 + (p^2 - 1)/4) = 3*a(n) (since b(n), where b(4*n+1) = a(n), is multiplicative). (End)
From Peter Bala, Mar 22 2021: (Start)
G.f. A(q) satisfies:
A(q^2) = Sum_{n = -oo..oo} q^n/(1 - q^(4*n+2)) (set z = q, alpha = q^2, mu = 4 in Agarwal, equation 6.15).
A(q^2) = Sum_{n = -oo..oo} q^(2*n)/(1 - q^(4*n+1)) (set z = q^2, alpha = q, mu = 4 in Agarwal, equation 6.15).
A(q^2) = Sum_{n = -oo..oo} q^n/(1 + q^(2*n+1))^2 = Sum_{n = -oo..oo} q^(3*n+1)/(1 + q^(2*n+1))^2. (End)
G.f.: Sum_{k>=0} a(k) * q^k = Sum_{k>=0} (-1)^k * q^(k*(k+1)) + 2 * Sum_{n>=1, k>=0} (-1)^k * q^(k*(k+2*n+1)+n). - Mamuka Jibladze, May 17 2021
G.f.: Sum_{k>=0} a(k) * q^k = Sum_{k>=0} (-1)^k * q^(k*(k+1)) * (1 + q^(2*k+1))/(1 - q^(2*k+1)). - Mamuka Jibladze, Jun 06 2021
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/2 (A019669). - Amiram Eldar, Oct 15 2022

Extensions

More terms and information from Michael Somos, Mar 23 2003
Previous Showing 11-20 of 1364 results. Next