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.

Showing 1-10 of 1511 results. Next

A000009 Expansion of Product_{m >= 1} (1 + x^m); number of partitions of n into distinct parts; number of partitions of n into odd parts.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 5, 6, 8, 10, 12, 15, 18, 22, 27, 32, 38, 46, 54, 64, 76, 89, 104, 122, 142, 165, 192, 222, 256, 296, 340, 390, 448, 512, 585, 668, 760, 864, 982, 1113, 1260, 1426, 1610, 1816, 2048, 2304, 2590, 2910, 3264, 3658, 4097, 4582, 5120, 5718, 6378
Offset: 0

Views

Author

Keywords

Comments

Partitions into distinct parts are sometimes called "strict partitions".
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
The result that number of partitions of n into distinct parts = number of partitions of n into odd parts is due to Euler.
Bijection: given n = L1* 1 + L2*3 + L3*5 + L7*7 + ..., a partition into odd parts, write each Li in binary, Li = 2^a1 + 2^a2 + 2^a3 + ... where the aj's are all different, then expand n = (2^a1 * 1 + ...)*1 + ... by removing the brackets and we get a partition into distinct parts. For the reverse operation, just keep splitting any even number into halves until no evens remain.
Euler transform of period 2 sequence [1,0,1,0,...]. - Michael Somos, Dec 16 2002
Number of different partial sums 1+[1,2]+[1,3]+[1,4]+..., where [1,x] indicates a choice. E.g., a(6)=4, as we can write 1+1+1+1+1+1, 1+2+3, 1+2+1+1+1, 1+1+3+1. - Jon Perry, Dec 31 2003
a(n) is the sum of the number of partitions of x_j into at most j parts, where j is the index for the j-th triangular number and n-T(j)=x_j. For example; a(12)=partitions into <= 4 parts of 12-T(4)=2 + partitions into <= 3 parts of 12-T(3)=6 + partitions into <= 2 parts of 12-T(2)=9 + partitions into 1 part of 12-T(1)=11 = (2)(11) + (6)(51)(42)(411)(33)(321)(222) + (9)(81)(72)(63)(54)+(11) = 2+7+5+1 = 15. - Jon Perry, Jan 13 2004
Number of partitions of n where if k is the largest part, all parts 1..k are present. - Jon Perry, Sep 21 2005
Jack Grahl and Franklin T. Adams-Watters prove this claim of Jon Perry's by observing that the Ferrers dual of a "gapless" partition is guaranteed to have distinct parts; since the Ferrers dual is an involution, this establishes a bijection between the two sets of partitions. - Allan C. Wechsler, Sep 28 2021
The number of connected threshold graphs having n edges. - Michael D. Barrus (mbarrus2(AT)uiuc.edu), Jul 12 2007
Starting with offset 1 = row sums of triangle A146061 and the INVERT transform of A000700 starting: (1, 0, 1, -1, 1, -1, 1, -2, 2, -2, 2, -3, 3, -3, 4, -5, ...). - Gary W. Adamson, Oct 26 2008
Number of partitions of n in which the largest part occurs an odd number of times and all other parts occur an even number of times. (Such partitions are the duals of the partitions with odd parts.) - David Wasserman, Mar 04 2009
Equals A035363 convolved with A010054. The convolution square of A000009 = A022567 = A000041 convolved with A010054. A000041 = A000009 convolved with A035363. - Gary W. Adamson, Jun 11 2009
Considering all partitions of n into distinct parts: there are A140207(n) partitions of maximal size which is A003056(n), and A051162(n) is the greatest number occurring in these partitions. - Reinhard Zumkeller, Jun 13 2009
Equals left border of triangle A091602 starting with offset 1. - Gary W. Adamson, Mar 13 2010
Number of symmetric unimodal compositions of n+1 where the maximal part appears once. Also number of symmetric unimodal compositions of n where the maximal part appears an odd number of times. - Joerg Arndt, Jun 11 2013
Because for these partitions the exponents of the parts 1, 2, ... are either 0 or 1 (j^0 meaning that part j is absent) one could call these partitions also 'fermionic partitions'. The parts are the levels, that is the positive integers, and the occupation number is either 0 or 1 (like Pauli's exclusion principle). The 'fermionic states' are denoted by these partitions of n. - Wolfdieter Lang, May 14 2014
The set of partitions containing only odd parts forms a monoid under the product described in comments to A047993. - Richard Locke Peterson, Aug 16 2018
Ewell (1973) gives a number of recurrences. - N. J. A. Sloane, Jan 14 2020
a(n) equals the number of permutations p of the set {1,2,...,n+1}, written in one line notation as p = p_1p_2...p_(n+1), satisfying p_(i+1) - p_i <= 1 for 1 <= i <= n, (i.e., those permutations that, when read from left to right, never increase by more than 1) whose major index maj(p) := Sum_{p_i > p_(i+1)} i equals n. For example, of the 16 permutations on 5 letters satisfying p_(i+1) - p_i <= 1, 1 <= i <= 4, there are exactly two permutations whose major index is 4, namely, 5 3 4 1 2 and 2 3 4 5 1. Hence a(4) = 2. See the Bala link in A007318 for a proof. - Peter Bala, Mar 30 2022
Conjecture: Each positive integer n can be written as a_1 + ... + a_k, where a_1,...,a_k are strict partition numbers (i.e., terms of the current sequence) with no one dividing another. This has been verified for n = 1..1350. - Zhi-Wei Sun, Apr 14 2023
Conjecture: For each integer n > 7, a(n) divides none of p(n), p(n) - 1 and p(n) + 1, where p(n) is the number of partitions of n given by A000041. This has been verified for n up to 10^5. - Zhi-Wei Sun, May 20 2023 [Verified for n <= 2*10^6. - Vaclav Kotesovec, May 23 2023]
The g.f. Product_{k >= 0} 1 + x^k = Product_{k >= 0} 1 - x^k + 2*x^k == Product_{k >= 0} 1 - x^k == Sum_{k in Z} (-1)^k*x^(k*(3*k-1)/2) (mod 2) by Euler's pentagonal number theorem. It follows that a(n) is odd iff n = k*(3*k - 1)/2 for some integer k, i.e., iff n is a generalized pentagonal number A001318. - Peter Bala, Jan 07 2025

Examples

			G.f. = 1 + x + x^2 + 2*x^3 + 2*x^4 + 3*x^5 + 4*x^6 + 5*x^7 + 6*x^8 + 8*x^9 + ...
G.f. = q + q^25 + q^49 + 2*q^73 + 2*q^97 + 3*q^121 + 4*q^145 + 5*q^169 + ...
The partitions of n into distinct parts (see A118457) for small n are:
  1: 1
  2: 2
  3: 3, 21
  4: 4, 31
  5: 5, 41, 32
  6: 6, 51, 42, 321
  7: 7, 61, 52, 43, 421
  8: 8, 71, 62, 53, 521, 431
  ...
From _Reinhard Zumkeller_, Jun 13 2009: (Start)
a(8)=6, A140207(8)=#{5+2+1,4+3+1}=2, A003056(8)=3, A051162(8)=5;
a(9)=8, A140207(9)=#{6+2+1,5+3+1,4+3+2}=3, A003056(9)=3, A051162(9)=6;
a(10)=10, A140207(10)=#{4+3+2+1}=1, A003056(10)=4, A051162(10)=4. (End)
		

References

  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education, Vol. 31, No. 1, pp. 24-28, Winter 1997. MathEduc Database (Zentralblatt MATH, 1997c.01891).
  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem II, Missouri Journal of Mathematical Sciences, Vol. 16, No. 1, Winter 2004, pp. 12-17. Zentralblatt MATH, Zbl 1071.05501.
  • George E. Andrews, The Theory of Partitions, Cambridge University Press, 1998, p. 19.
  • George E. Andrews, Number Theory, Dover Publications, 1994, Theorem 12-3, pp. 154-5, and (13-1-1) p. 163.
  • Raymond Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; see p. 196.
  • T. J. I'a. Bromwich, Introduction to the Theory of Infinite Series, Macmillan, 2nd. ed. 1949, p. 116, Problem 18.
  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 99.
  • William Dunham, The Mathematical Universe, pp. 57-62, J. Wiley, 1994.
  • Leonhard Euler, De partitione numerorum, Novi commentarii academiae scientiarum Petropolitanae 3 (1750/1), 1753, reprinted in: Commentationes Arithmeticae. (Opera Omnia. Series Prima: Opera Mathematica, Volumen Secundum), 1915, Lipsiae et Berolini, 254-294.
  • Ian P. Goulden and David M. Jackson, Combinatorial Enumeration, Wiley, N.Y., 1983, (2.5.1).
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 86.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 277, Theorems 344, 346.
  • Carlos J. Moreno and Samuel S. Wagstaff, Jr., Sums of Squares of Integers, Chapman and Hall, 2006, p. 253.
  • Srinivasa Ramanujan, Collected Papers, Ed. G. H. Hardy et al., Cambridge 1927; Chelsea, NY, 1962. See Table V on page 309.
  • 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).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 288-290.

Crossrefs

Apart from the first term, equals A052839-1. The rows of A053632 converge to this sequence. When reduced modulo 2 equals the absolute values of A010815. The positions of odd terms given by A001318.
a(n) = Sum_{n=1..m} A097306(n, m), row sums of triangle of number of partitions of n into m odd parts.
Cf. A001318, A000041, A000700, A003724, A004111, A007837, A010815, A035294, A068049, A078408, A081360, A088670, A109950, A109968, A132312, A146061, A035363, A010054, A057077, A089806, A091602, A237515, A118457 (the partitions), A118459 (partition lengths), A015723 (total number of parts), A230957 (boustrophedon transform).
Cf. A167377 (complement).
Cf. A067659 (odd number of parts), A067661 (even number of parts).
Number of r-regular partitions for r = 2 through 12: A000009, A000726, A001935, A035959, A219601, A035985, A261775, A104502, A261776, A328545, A328546.

Programs

  • Haskell
    import Data.MemoCombinators (memo2, integral)
    a000009 n = a000009_list !! n
    a000009_list = map (pM 1) [0..] where
       pM = memo2 integral integral p
       p _ 0 = 1
       p k m | m < k     = 0
             | otherwise = pM (k + 1) (m - k) + pM (k + 1) m
    -- Reinhard Zumkeller, Sep 09 2015, Nov 05 2013
    
  • Julia
    # uses A010815
    using Memoize
    @memoize function A000009(n)
        n == 0 && return 1
        s = sum((-1)^k*A000009(n - k^2) for k in 1:isqrt(n))
        A010815(n) - 2*s
    end # Peter Luschny, Sep 09 2021
  • Magma
    Coefficients(&*[1+x^m:m in [1..100]])[1..100] where x is PolynomialRing(Integers()).1; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
    
  • Maple
    N := 100; t1 := series(mul(1+x^k,k=1..N),x,N); A000009 := proc(n) coeff(t1,x,n); end;
    spec := [ P, {P=PowerSet(N), N=Sequence(Z,card>=1)} ]: [ seq(combstruct[count](spec, size=n), n=0..58) ];
    spec := [ P, {P=PowerSet(N), N=Sequence(Z,card>=1)} ]: combstruct[allstructs](spec, size=10); # to get the actual partitions for n=10
    A000009 := proc(n)
        local x,m;
        product(1+x^m,m=1..n+1) ;
        expand(%) ;
        coeff(%,x,n) ;
    end proc: # R. J. Mathar, Jun 18 2016
    lim := 99; # Enlarge if more terms are needed.
    simplify(expand(QDifferenceEquations:-QPochhammer(-1, x, lim)/2, x)):
    seq(coeff(%, x, n), n=0..55); # Peter Luschny, Nov 17 2016
    # Alternative:
    a:= proc(n) option remember; `if`(n=0, 1, add(a(n-j)*add(
         `if`(d::odd, d, 0), d=numtheory[divisors](j)), j=1..n)/n)
        end:
    seq(a(n), n=0..55);  # Alois P. Heinz, Jun 24 2025
  • Mathematica
    PartitionsQ[Range[0, 60]] (* Harvey Dale, Jul 27 2009 *)
    a[ n_] := SeriesCoefficient[ Product[ 1 + x^k, {k, n}], {x, 0, n}]; (* Michael Somos, Jul 06 2011 *)
    a[ n_] := SeriesCoefficient[ 1 / Product[ 1 - x^k, {k, 1, n, 2}], {x, 0, n}]; (* Michael Somos, Jul 06 2011 *)
    a[ n_] := With[ {t = Log[q] / (2 Pi I)}, SeriesCoefficient[ q^(-1/24) DedekindEta[2 t] / DedekindEta[ t], {q, 0, n}]]; (* Michael Somos, Jul 06 2011 *)
    a[ n_] := SeriesCoefficient[ 1 / QPochhammer[ x, x^2], {x, 0, n}]; (* Michael Somos, May 24 2013 *)
    a[ n_] := SeriesCoefficient[ Series[ QHypergeometricPFQ[ {q}, {q x}, q, - q x], {q, 0, n}] /. x -> 1, {q, 0, n}]; (* Michael Somos, Mar 04 2014 *)
    a[ n_] := SeriesCoefficient[ QHypergeometricPFQ[{}, {}, q, -1] / 2, {q, 0, n}]; (* Michael Somos, Mar 04 2014 *)
    nmax = 60; CoefficientList[Series[Exp[Sum[(-1)^(k+1)/k*x^k/(1-x^k), {k, 1, nmax}]], {x, 0, nmax}], x] (* Vaclav Kotesovec, Aug 25 2015 *)
    nmax = 100; poly = ConstantArray[0, nmax + 1]; poly[[1]] = 1; poly[[2]] = 1; Do[Do[poly[[j + 1]] += poly[[j - k + 1]], {j, nmax, k, -1}];, {k, 2, nmax}]; poly (* Vaclav Kotesovec, Jan 14 2017 *)
  • Maxima
    num_distinct_partitions(60,list); /* Emanuele Munarini, Feb 24 2014 */
    
  • Maxima
    h(n):=if oddp(n)=true then 1 else 0;
    S(n,m):=if n=0 then 1 else if nVladimir Kruchinin, Sep 07 2014 */
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( prod( k=1, n, 1 + x^k, 1 + x * O(x^n)), n))}; /* Michael Somos, Nov 17 1999 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A) / eta(x + A), n))};
    
  • PARI
    {a(n) = my(c); forpart(p=n, if( n<1 || p[1]<2, c++; for(i=1, #p-1, if( p[i+1] > p[i]+1, c--; break)))); c}; /* Michael Somos, Aug 13 2017 */
    
  • PARI
    lista(nn) = {q='q+O('q^nn); Vec(eta(q^2)/eta(q))} \\ Altug Alkan, Mar 20 2018
    
  • Python
    # uses A010815
    from functools import lru_cache
    from math import isqrt
    @lru_cache(maxsize=None)
    def A000009(n): return 1 if n == 0 else A010815(n)+2*sum((-1)**(k+1)*A000009(n-k**2) for k in range(1,isqrt(n)+1)) # Chai Wah Wu, Sep 08 2021
    
  • Python
    import numpy as np
    n = 1000
    arr = np.zeros(n,dtype=object)
    arr[0] = 1
    for i in range(1,n):
        arr[i:] += arr[:n-i]
    print(arr) # Yigit Oktar, Jul 12 2025
    
  • SageMath
    # uses[EulerTransform from A166861]
    a = BinaryRecurrenceSequence(0, 1)
    b = EulerTransform(a)
    print([b(n) for n in range(56)]) # Peter Luschny, Nov 11 2020
    

Formula

G.f.: Product_{m>=1} (1 + x^m) = 1/Product_{m>=0} (1-x^(2m+1)) = Sum_{k>=0} Product_{i=1..k} x^i/(1-x^i) = Sum_{n>=0} x^(n*(n+1)/2) / Product_{k=1..n} (1-x^k).
G.f.: Sum_{n>=0} x^n*Product_{k=1..n-1} (1+x^k) = 1 + Sum_{n>=1} x^n*Product_{k>=n+1} (1+x^k). - Joerg Arndt, Jan 29 2011
Product_{k>=1} (1+x^(2k)) = Sum_{k>=0} x^(k*(k+1))/Product_{i=1..k} (1-x^(2i)) - Euler (Hardy and Wright, Theorem 346).
Asymptotics: a(n) ~ exp(Pi l_n / sqrt(3)) / ( 4 3^(1/4) l_n^(3/2) ) where l_n = (n-1/24)^(1/2) (Ayoub).
For n > 1, a(n) = (1/n)*Sum_{k=1..n} b(k)*a(n-k), with a(0)=1, b(n) = A000593(n) = sum of odd divisors of n; cf. A000700. - Vladeta Jovovic, Jan 21 2002
a(n) = t(n, 0), t as defined in A079211.
a(n) = Sum_{k=0..n-1} A117195(n,k) = A117192(n) + A117193(n) for n>0. - Reinhard Zumkeller, Mar 03 2006
a(n) = A026837(n) + A026838(n) = A118301(n) + A118302(n); a(A001318(n)) = A051044(n); a(A090864(n)) = A118303(n). - Reinhard Zumkeller, Apr 22 2006
Expansion of 1 / chi(-x) = chi(x) / chi(-x^2) = f(-x) / phi(x) = f(x) / phi(-x^2) = psi(x) / f(-x^2) = f(-x^2) / f(-x) = f(-x^4) / psi(-x) in powers of x where phi(), psi(), chi(), f() are Ramanujan theta functions. - Michael Somos, Mar 12 2011
G.f. is a period 1 Fourier series which satisfies f(-1 / (1152 t)) = 2^(-1/2) / f(t) where q = exp(2 Pi i t). - Michael Somos, Aug 16 2007
Expansion of q^(-1/24) * eta(q^2) / eta(q) in powers of q.
Expansion of q^(-1/24) 2^(-1/2) f2(t) in powers of q = exp(2 Pi i t) where f2() is a Weber function. - Michael Somos, Oct 18 2007
Given g.f. A(x), then B(x) = x * A(x^3)^8 satisfies 0 = f(B(x), B(x^2)) where f(u, v) = v - u^2 + 16*u*v^2 . - Michael Somos, May 31 2005
Given g.f. A(x), then B(x) = x * A(x^8)^3 satisfies 0 = f(B(x), B(x^3)) where f(u, v) = (u^3 - v) * (u + v^3) - 9 * u^3 * v^3. - Michael Somos, Mar 25 2008
From Evangelos Georgiadis, Andrew V. Sutherland, Kiran S. Kedlaya (egeorg(AT)mit.edu), Mar 03 2009: (Start)
a(0)=1; a(n) = 2*(Sum_{k=1..floor(sqrt(n))} (-1)^(k+1) a(n-k^2)) + sigma(n) where sigma(n) = (-1)^j if (n=(j*(3*j+1))/2 OR n=(j*(3*j-1))/2) otherwise sigma(n)=0 (simpler: sigma = A010815). (End)
From Gary W. Adamson, Jun 13 2009: (Start)
The product g.f. = (1/(1-x))*(1/(1-x^3))*(1/(1-x^5))*...; = (1,1,1,...)*
(1,0,0,1,0,0,1,0,0,1,...)*(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,...) * ...; =
a*b*c*... where a, a*b, a*b*c, ... converge to A000009:
1, 1, 1, 2, 2, 2, 3, 3, 3, 4, ... = a*b
1, 1, 1, 2, 2, 3, 4, 4, 5, 6, ... = a*b*c
1, 1, 1, 2, 2, 3, 4, 5, 6, 7, ... = a*b*c*d
1, 1, 1, 2, 2, 3, 4, 5, 6, 8, ... = a*b*c*d*e
1, 1, 1, 2, 2, 3, 4, 5, 6, 8, ... = a*b*c*d*e*f
... (cf. analogous example in A000041). (End)
a(A004526(n)) = A172033(n). - Reinhard Zumkeller, Jan 23 2010
a(n) = P(n) - P(n-2) - P(n-4) + P(n-10) + P(n-14) + ... + (-1)^m P(n-2p_m) + ..., where P(n) is the partition function (A000041) and p_m = m(3m-1)/2 is the m-th generalized pentagonal number (A001318). - Jerome Malenfant, Feb 16 2011
a(n) = A054242(n,0) = A201377(n,0). - Reinhard Zumkeller, Dec 02 2011
More precise asymptotics: a(n) ~ exp(Pi*sqrt((n-1/24)/3)) / (4*3^(1/4)*(n-1/24)^(3/4)) * (1 + (Pi^2-27)/(24*Pi*sqrt(3*(n-1/24))) + (Pi^4-270*Pi^2-1215)/(3456*Pi^2*(n-1/24))). - Vaclav Kotesovec, Nov 30 2015
a(n) = A067661(n) + A067659(n). Wolfdieter Lang, Jan 18 2016
From Vaclav Kotesovec, May 29 2016: (Start)
a(n) ~ exp(Pi*sqrt(n/3))/(4*3^(1/4)*n^(3/4)) * (1 + (Pi/(48*sqrt(3)) - (3*sqrt(3))/(8*Pi))/sqrt(n) + (Pi^2/13824 - 5/128 - 45/(128*Pi^2))/n).
a(n) ~ exp(Pi*sqrt(n/3) + (Pi/(48*sqrt(3)) - 3*sqrt(3)/(8*Pi))/sqrt(n) - (1/32 + 9/(16*Pi^2))/n) / (4*3^(1/4)*n^(3/4)).
(End)
a(n) = A089806(n)*A010815(floor(n/2)) + a(n-1) + a(n-2) - a(n-5) - a(n-7) + a(n-12) + ... + A057077(m-1)*a(n-A001318(m)) + ..., where n > A001318(m). - Gevorg Hmayakyan, Jul 07 2016
a(n) ~ Pi*BesselI(1, Pi*sqrt((n+1/24)/3)) / sqrt(24*n+1). - Vaclav Kotesovec, Nov 08 2016
a(n) = A000041(n) - A047967(n). - R. J. Mathar, Nov 20 2017
Sum_{n>=1} 1/a(n) = A237515. - Amiram Eldar, Nov 15 2020
From Peter Bala, Jan 15 2021: (Start)
G.f.: (1 + x)*Sum_{n >= 0} x^(n*(n+3)/2)/Product_{k = 1..n} (1 - x^k) =
(1 + x)*(1 + x^2)*Sum_{n >= 0} x^(n*(n+5)/2)/Product_{k = 1..n} (1 - x^k) = (1 + x)*(1 + x^2)*(1 + x^3)*Sum_{n >= 0} x^(n*(n+7)/2)/Product_{k = 1..n} (1 - x^k) = ....
G.f.: (1/2)*Sum_{n >= 0} x^(n*(n-1)/2)/Product_{k = 1..n} (1 - x^k) =
(1/2)*(1/(1 + x))*Sum_{n >= 0} x^((n-1)*(n-2)/2)/Product_{k = 1..n} (1 - x^k) = (1/2)*(1/((1 + x)*(1 + x^2)))*Sum_{n >= 0} x^((n-2)*(n-3)/2)/Product_{k = 1..n} (1 - x^k) = ....
G.f.: Sum_{n >= 0} x^n/Product_{k = 1..n} (1 - x^(2*k)) = (1/(1 - x)) * Sum_{n >= 0} x^(3*n)/Product_{k = 1..n} (1 - x^(2*k)) = (1/((1 - x)*(1 - x^3))) * Sum_{n >= 0} x^(5*n)/Product_{k = 1..n} (1 - x^(2*k)) = (1/((1 - x)*(1 - x^3)*(1 - x^5))) * Sum_{n >= 0} x^(7*n)/Product_{k = 1..n} (1 - x^(2*k)) = .... (End)
From Peter Bala, Feb 02 2021: (Start)
G.f.: A(x) = Sum_{n >= 0} x^(n*(2*n-1))/Product_{k = 1..2*n} (1 - x^k). (Set z = x and q = x^2 in Mc Laughlin et al. (2019 ArXiv version), Section 1.3, Identity 7.)
Similarly, A(x) = Sum_{n >= 0} x^(n*(2*n+1))/Product_{k = 1..2*n+1} (1 - x^k). (End)
a(n) = A001227(n) + A238005(n) + A238006(n). - R. J. Mathar, Sep 08 2021
G.f.: A(x) = exp ( Sum_{n >= 1} x^n/(n*(1 - x^(2*n))) ) = exp ( Sum_{n >= 1} (-1)^(n+1)*x^n/(n*(1 - x^n)) ). - Peter Bala, Dec 23 2021
Sum_{n>=0} a(n)/exp(Pi*n) = exp(Pi/24)/2^(1/8) = A292820. - Simon Plouffe, May 12 2023 [Proof: Sum_{n>=0} a(n)/exp(Pi*n) = phi(exp(-2*Pi)) / phi(exp(-Pi)), where phi(q) is the Euler modular function. We have phi(exp(-2*Pi)) = exp(Pi/12) * Gamma(1/4) / (2 * Pi^(3/4)) and phi(exp(-Pi)) = exp(Pi/24) * Gamma(1/4) / (2^(7/8) * Pi^(3/4)), see formulas (14) and (13) in I. Mező, 2013. - Vaclav Kotesovec, May 12 2023]
a(2*n) = Sum_{j=1..n} p(n+j, 2*j) and a(2*n+1) = Sum_{j=1..n+1} p(n+j,2*j-1), where p(n, s) is the number of partitions of n having exactly s parts. - Gregory L. Simay, Aug 30 2023

A000700 Expansion of Product_{k>=0} (1 + x^(2k+1)); number of partitions of n into distinct odd parts; number of self-conjugate partitions; number of symmetric Ferrers graphs with n nodes.

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

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Coefficients of replicable function number 96a. - N. J. A. Sloane, Jun 10 2015
For n >= 1, a(n) is the minimal row sum in the character table of the symmetric group S_n. The minimal row sum in the table corresponds to the one-dimensional alternating representation of S_n. The maximal row sum is in sequence A085547. - Yuval Dekel (dekelyuval(AT)hotmail.com), Sep 15 2003
Also the number of partitions of n into parts != 2 and differing by >= 6 with strict inequality if a part is even. [Alladi]
Let S be the set formed by the partial sums of 1+[2,3]+[2,5]+[2,7]+[2,9]+..., where [2,odd] indicates a choice, e.g., we may have 1+2, or 1+3+2, or 1+3+5+2+9, etc. Then A000700(n) is the number of elements of S that equal n. Also A000700(n) is the same parity as A000041(n) (the partition numbers). - Jon Perry, Dec 18 2003
a(n) is for n >= 2 the number of conjugacy classes of the symmetric group S_n which split into two classes under restriction to A_n, the alternating group. See the G. James - A. Kerber reference given under A115200, p. 12, 1.2.10 Lemma and the W. Lang link under A115198.
Also number of partitions of n such that if k is the largest part, then k occurs an odd number of times and each integer from 1 to k-1 occurs a positive even number of times (these are the conjugates of the partitions of n into distinct odd parts). Example: a(15)=4 because we have [3,3,3,2,2,1,1], [3,2,2,2,2,1,1,1,1], [3,2,2,1,1,1,1,1,1,1,1] and [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]. - Emeric Deutsch, Apr 16 2006
The INVERTi transform of A000009 (number of partitions of n into odd parts starting with offset 1) = (1, 0, 1, -1, 1, -1, 1, -2, 2, -2, 2, -3, 3, -3, 4, ...); = left border of triangle A146061. - Gary W. Adamson, Oct 26 2008
For n even: the sum over all even nonnegative integers, k, such that k^2 < n, of the number of partitions of (n-k^2)/2 into parts of size at most k. For n odd: the sum over all odd nonnegative integers, j, such that j^2 < n, of the number of partitions of (n-j^2)/2 into parts of size at most j. - Graham H. Hawkes, Oct 18 2013
This number is also (the number of conjugacy classes of S_n containing even permutations) - (the number of conjugacy classes of S_n containing odd permutations) = (the number of partitions of n into a number of parts having the same parity as n) - (the number of partitions of n into a number of parts having opposite parity as n) = (the number of partitions of n with largest part having same parity as n) - (the number of partitions with largest part having opposite parity as n). - David L. Harden, Dec 09 2016
a(n) is odd iff n belongs to A052002; that is, Sum_{n>=0} x^A052002(n) == Sum_{n>=0} a(n)*x^n (mod 2). - Peter Bala, Jan 22 2017
Also the number of conjugacy classes of S_n whose members yield unique square roots, i.e., there exists a unique h in S_n such that hh = g for any g in such a conjugacy class. Proof: first note that a permutation's square roots are determined by the product of the square roots of its decomposition into cycles of different lengths. h can only travel to one other cycle before it must "return home" (h^2(x) = g(x) must be in x's cycle), and, because if g^n(x) = x then h^2n(x) = x and h^2n(h(x)) = h(x), this "traveling" must preserve cycle length or one cycle will outpace the other. However, a permutation decomposing into two cycles of the same length has multiple square roots: for example, e = e^2 = (a b)^2, (a b)(c d) = (a c b d)^2 = (a d b c)^2, (a b c)(d e f) = (a d b e c f)^2 = (a e b f c d)^2, etc. This is true for any cycle length so we need only consider permutations with distinct cycle lengths. Finally, even cycle lengths are odd permutations and thus cannot be square, while odd cycle lengths have the unique square root h(x) = g^((n+1)/2)(x). Thus there is a correspondence between these conjugacy classes and partitions into distinct odd parts. - Keith J. Bauer, Jan 09 2024
a(2*n) equals the number of partitions of n into parts congruent to +-2, +-3, +-4 or +-5 mod 16. See Merca, 2015, Corollary 4.3. - Peter Bala, Dec 12 2024

Examples

			T96a = 1/q + q^23 + q^71 + q^95 + q^119 + q^143 + q^167 + 2*q^191 + ...
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 + 3*x^12 + ...
		

References

  • R. Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; see p. 197.
  • B. C. Berndt, Ramanujan's theory of theta-functions, Theta functions: from the classical to the modern, Amer. Math. Soc., Providence, RI, 1993, pp. 1-63. MR 94m:11054.
  • T. J. I'a. Bromwich, Introduction to the Theory of Infinite Series, Macmillan, 2nd. ed. 1949, p. 116, see q_2.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 86.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 277, Theorems 345, 347.
  • 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

Main diagonal of A218907.

Programs

  • Magma
    m:=80;
    R:=PowerSeriesRing(Integers(), m);
    Coefficients(R!( (&*[1 + x^(2*j+1): j in [0..m+2]]) )); // G. C. Greubel, Sep 07 2023
    
  • Maple
    N := 100; t1 := series(mul(1+x^(2*k+1),k=0..N),x,N); A000700 := proc(n) coeff(t1,x,n); end;
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(n>i^2, 0,
           b(n, i-1)+`if`(i*2-1>n, 0, b(n-(i*2-1), i-1))))
        end:
    a:= n-> b(n, iquo(n+1, 2)):
    seq(a(n), n=0..80);  # Alois P. Heinz, Mar 12 2016
  • Mathematica
    CoefficientList[ Series[ Product[1 + x^(2k + 1), {k, 0, 75}], {x, 0, 70}], x] (* Robert G. Wilson v, Aug 22 2004 *)
    a[ n_] := With[ {m = InverseEllipticNomeQ[ q]}, SeriesCoefficient[ ((1 - m) m /(16 q))^(-1/24), {q, 0, n}]]; (* Michael Somos, Jul 11 2011 *)
    a[ n_] := SeriesCoefficient[ Product[1 + x^k, {k, 1, n, 2}], {x, 0, n}]; (* Michael Somos, Jul 11 2011 *)
    p[n_] := p[n] = Select[Select[IntegerPartitions[n], DeleteDuplicates[#] == # &], Apply[And, OddQ[#]] &]; Table[p[n], {n, 0, 20}] (* shows partitions of n into distinct odd parts *)
    Table[Length[p[n]], {n, 0, 20}] (* A000700(n), n >= 0 *)
    conjugatePartition[part_] := Table[Count[#, ?(# >= i &)], {i, First[#]}] &[part]; s[n] := s[n] = Select[IntegerPartitions[n], conjugatePartition[#] == # &]; Table[s[n], {n, 1, 20}]  (* shows self-conjugate partitions *)
    Table[Length[s[n]], {n, 1, 20}]  (* A000700(n), n >= 1 *)
    (* Peter J. C. Moses, Mar 12 2014 *)
    CoefficientList[QPochhammer[q^2]^2/(QPochhammer[q]*QPochhammer[q^4]) + O[q]^70, q] (* Jean-François Alcover, Nov 05 2015, after Michael Somos *)
    (O[x]^70 + 2/QPochhammer[-1, -x])[[3]] (* Vladimir Reshetnikov, Nov 20 2015 *)
    nmax = 100; poly = ConstantArray[0, nmax + 1]; poly[[1]] = 1; poly[[2]] = 1; Do[Do[If[OddQ[k], poly[[j + 1]] += poly[[j - k + 1]]], {j, nmax, k, -1}];, {k, 2, nmax}]; poly (* Vaclav Kotesovec, Nov 24 2017 *)
  • Maxima
    S(n,m):=if n=0 then 1 else if nVladimir Kruchinin, Sep 07 2014 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^2 / (eta(x + A) * eta(x^4 + A)), n))}; /* Michael Somos, Jun 11 2004 */
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( 1 / prod( k=1, n, 1 + (-x)^k, 1 + x * O(x^n)), n))}; /* Michael Somos, Jun 11 2004 */
    
  • PARI
    my(x='x+O('x^70)); Vec(eta(x^2)^2/(eta(x)*eta(x^4))) \\ Joerg Arndt, Sep 07 2023
    
  • Python
    from math import prod
    from sympy import factorint
    def A000700(n): return 1 if n== 0 else sum((-1)**(k+1)*A000700(n-k)*prod((p**(e+1)-1)//(p-1) for p, e in factorint(k).items() if p > 2) for k in range(1,n+1))//n # Chai Wah Wu, Sep 09 2021
    
  • SageMath
    from sage.modular.etaproducts import qexp_eta
    m=80
    def f(x): return qexp_eta(QQ[['q']], m+2).subs(q=x)
    def A000700_list(prec):
        P. = PowerSeriesRing(QQ, prec)
        return P( f(x^2)^2/(f(x)*f(x^4)) ).list()
    A000700_list(m) # G. C. Greubel, Sep 07 2023

Formula

G.f.: Product_{k>=1} (1 + x^(2*k-1)).
G.f.: Sum_{k>=0} x^(k^2)/Product_{i=1..k} (1-x^(2*i)). - Euler (Hardy and Wright, Theorem 345)
G.f.: 1/Product_{i>=1} (1 + (-x)^i). - Jon Perry, May 27 2004
Expansion of chi(q) = (-q; q^2)_oo = f(q) / f(-q^2) = phi(q) / f(q) = f(-q^2) / psi(-q) = phi(-q^2) / f(-q) = psi(q) / f(-q^4), where phi(), chi(), psi(), f() are Ramanujan theta functions.
Sum_{k=0..n} A081360(k)*a(n-k) = 0, for n > 0. - John W. Layman, Apr 26 2000
Euler transform of period-4 sequence [1, -1, 1, 0, ...].
Expansion of q^(1/24) * eta(q^2)^2 /(eta(q) * eta(q^4)) in powers of q. - Michael Somos, Jun 11 2004
Asymptotics: a(n) ~ exp(Pi*l_n)/(2*24^(1/4)*l_n^(3/2)) where l_n = (n-1/24)^(1/2) (Ayoub). The asymptotic formula in Ayoub is incorrect, as that would imply faster growth than the total number of partitions. (It was quoted correctly, the book is just wrong, not sure what the correct asymptotic is.) - Edward Early, Nov 15 2002. Right formula is a(n) ~ exp(Pi*sqrt(n/6)) / (2*24^(1/4)*n^(3/4)). - Vaclav Kotesovec, Jun 23 2014
a(n) = (1/n)*Sum_{k = 1..n} (-1)^(k+1)*b(k)*a(n-k), n>1, a(0) = 1, b(n) = A000593(n) = sum of odd divisors of n. - Vladeta Jovovic, Jan 19 2002 [see Theorem 2(a) in N. Robbins's article]
For n > 0: a(n) = b(n, 1) where b(n, k) = b(n-k, k+2) + b(n, k+2) if k < n, otherwise (n mod 2) * 0^(k-n). - Reinhard Zumkeller, Aug 26 2003
Expansion of q^(1/24) * (m * (1 - m) / 16)^(-1/24) in powers of q where m = k^2 is the parameter and q is the nome for Jacobian elliptic functions.
Given g.f. A(x), B(q) = (1/q)* A(q^3)^8 satisfies 0 = f(B(q), B(q^2)) where f(u, v) = u*v * (u - v^2) * (v - u^2) - (4 * (1 - u*v))^2. - Michael Somos, Jul 16 2007
G.f. is a period 1 Fourier series which satisfies f(-1 / (2304 t)) = f(t) where q = exp(2 Pi i t). - Michael Somos, Jul 16 2007
Expansion of q^(1/24)*f(t) in powers of q = exp(Pi*i*t) where f() is Weber's function. - Michael Somos, Oct 18 2007
A069911(n) = a(2*n + 1). A069910(n) = a(2*n).
a(n) = Sum_{k=1..n} (-1)^(n-k) A008284(n,k). - Jeremy L. Martin, Jul 06 2013
a(n) = S(n,1), where S(n,m) = Sum_{k=m..n/2} (-1)^(k+1)*S(n-k,k) + (-1)^(n+1), S(n,n)=(-1)^(n+1), S(0,m)=1, S(n,m)=0 for n < m. - Vladimir Kruchinin, Sep 07 2014
G.f.: Product_{k>0} (1 + x^(2*k-1)) = Product_{k>0} (1 - (-x)^k) / (1 - (-x)^(2*k)) = Product_{k>0} 1 / (1 + (-x)^k). - Michael Somos, Nov 08 2014
a(n) ~ Pi * BesselI(1, Pi*sqrt(24*n-1)/12) / sqrt(24*n-1) ~ exp(Pi*sqrt(n/6)) / (2^(7/4) * 3^(1/4) * n^(3/4)) * (1 - (3*sqrt(6)/(8*Pi) + Pi/(48*sqrt(6))) / sqrt(n) + (5/128 - 45/(64*Pi^2) + Pi^2/27648) / n). - Vaclav Kotesovec, Jan 08 2017
G.f.: exp(Sum_{k>=1} x^k/(k*(1 - (-x)^k))). - Ilya Gutkovskiy, Jun 07 2018
Given g.f. A(x), B(q) = (1/q) * A(q^24) / 2^(1/4) satisfies 0 = f(B(q), B(q^5)) where f(u, v) = u^6 + v^6 + 2*u*v * (1 - (u*v)^4). - Michael Somos, Mar 14 2019
G.f.: Sum_{n >= 0} x^n/Product_{i = 1..n} ( 1 + (-1)^(i+1)*x^i ). - Peter Bala, Nov 30 2020
From Peter Bala, Jan 15 2021: (Start)
G.f.: (1 + x) * Sum_{n >= 0} x^(n*(n+2))/Product_{k = 1..n} (1 - x^(2*k)) = (1 + x)*(1 + x^3) * Sum_{n >= 0} x^(n*(n+4))/Product_{k = 1..n} (1 - x^(2*k)) = (1 + x)*(1 + x^3)*(1 + x^5) * Sum_{n >= 0} x^(n*(n+6))/ Product_{k = 1..n} (1 - x^(2*k)) = ....
G.f.: 1/(1 + x) * Sum_{n >= 0} x^(n-1)^2/Product_{k = 1..n} (1 - x^(2*k)) = 1/((1 + x)*(1 + x^3)) * Sum_{n >= 0} x^(n-2)^2/Product_{k = 1..n} (1 - x^(2*k)) = 1/((1 + x)*(1 + x^3)*(1 + x^5)) * Sum_{n >= 0} x^(n-3)^2/ Product_{k = 1..n} (1 - x^(2*k)) = .... (End)
a(n) = A046682(n) - A000701(n). See Gupta and also Ballantine et al. - Michel Marcus, Sep 04 2021
G.f.: A(x) = exp( Sum_{k >= 1} (-1)^k/(k*(x^k - x^(-k))) ). - Peter Bala, Dec 23 2021

A010054 a(n) = 1 if n is a triangular number, otherwise 0.

Original entry on oeis.org

1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Keywords

Comments

This is essentially the q-expansion of the Jacobi theta function theta_2(q). (In theta_2 one has to ignore the initial factor of 2*q^(1/4) and then replace q by q^(1/2). See also A005369.) - N. J. A. Sloane, Aug 03 2014
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Ramanujan's theta function f(a, b) = Sum_{n=-inf..inf} a^(n*(n+1)/2) * b^(n*(n-1)/2).
This sequence is the concatenation of the base-b digits in the sequence b^n, for any base b >= 2. - Davis Herring (herring(AT)lanl.gov), Nov 16 2004
Number of partitions of n into distinct parts such that the greatest part equals the number of all parts, see also A047993; a(n)=A117195(n,0) for n > 0; a(n) = 1-A117195(n,1) for n > 1. - Reinhard Zumkeller, Mar 03 2006
Triangle T(n,k), 0 <= k <= n, read by rows, given by A000007 DELTA A000004 where DELTA is the operator defined in A084938. - Philippe Deléham, Jan 03 2009
Convolved with A000041 = A022567, the convolution square of A000009. - Gary W. Adamson, Jun 11 2009
A008441(n) = Sum_{k=0..n} a(k)*a(n-k). - Reinhard Zumkeller, Nov 03 2009
Polcoeff inverse with alternate signs = A006950: (1, 1, 1, 2, 3, 4, 5, 7, ...). - Gary W. Adamson, Mar 15 2010
This sequence is related to Ramanujan's two-variable theta functions because this sequence is also the characteristic function of generalized hexagonal numbers. - Omar E. Pol, Jun 08 2012
Number 3 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
Number of partitions of n into consecutive parts that contain 1 as a part, n >= 1. - Omar E. Pol, Nov 27 2020
The constant whose decimal expansion is this sequence is irrational (Mahler, 1981). The constant whose expansion in any base b >= 2 is this sequence is irrational (Bundschuh, 1984). - Amiram Eldar, Mar 23 2025

Examples

			G.f. = 1 + x + x^3 + x^6 + x^10 + x^15 + x^21 + x^28 + x^36 + x^45 + x^55 + x^66 + ...
G.f. for B(q) = q * A(q^8): q + q^9 + q^25 + q^49 + q^81 + q^121 + q^169 + q^225 + q^289 + q^361 + ...
From _Philippe Deléham_, Jan 04 2008: (Start)
As a triangle this begins:
  1;
  1, 0;
  1, 0, 0;
  1, 0, 0, 0;
  1, 0, 0, 0, 0;
  1, 0, 0, 0, 0, 0;
  ...  (End)
		

References

  • J. H. Conway and N. J. A. Sloane, Sphere Packings, Lattices and Groups, Springer-Verlag, 1999, p. 103.
  • Michael D. Hirschhorn, The Power of q, Springer, 2017. See Psi, page 9.
  • Jules Tannery and Jules Molk, Eléments de la Théorie des Fonctions Elliptiques, Vol. 2, Gauthier-Villars, Paris, 1902; Chelsea, NY, 1972, see p. 27.
  • Edmund T. Whittaker and George N. Watson, A Course of Modern Analysis, Cambridge Univ. Press, 4th ed., 1963, p. 464.

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.
Cf. A106507 (reciprocal series).

Programs

  • Clojure
    (def A010054 (mapcat #(cons 1 (replicate % 0)) (range))) ; Tony Zorman, Apr 03 2023
  • Haskell
    a010054 = a010052 . (+ 1) . (* 8)
    a010054_list = concatMap (\x -> 1 : replicate x 0) [0..]
    -- Reinhard Zumkeller, Feb 12 2012, Oct 22 2011, Apr 02 2011
    
  • Magma
    Basis( ModularForms( Gamma0(16), 1/2), 362) [2] ; /* Michael Somos, Jun 10 2014 */
    
  • Maple
    A010054 := proc(n)
        if issqr(1+8*n) then
            1;
        else
            0;
        end if;
    end proc:
    seq(A010054(n),n=0..80) ; # R. J. Mathar, Feb 22 2021
  • Mathematica
    a[ n_] := SquaresR[ 1, 8 n + 1] / 2; (* Michael Somos, Nov 15 2011 *)
    a[ n_] := If[ n < 0, 0, SeriesCoefficient[ (Series[ EllipticTheta[ 3, Log[y] / (2 I), x^2], {x, 0, n + Floor @ Sqrt[n]}] // Normal // TrigToExp) /. {y -> x}, {x, 0, n}]]; (* Michael Somos, Nov 15 2011 *)
    Table[If[IntegerQ[(Sqrt[8n+1]-1)/2],1,0],{n,0,110}] (* Harvey P. Dale, Oct 29 2012 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, 0, q^(1/2)] / (2 q^(1/8)), {q, 0, n}]; (* Michael Somos, Jul 01 2014 *)
    Module[{tr=Accumulate[Range[20]]},If[MemberQ[tr,#],1,0]&/@Range[Max[tr]]] (* Harvey P. Dale, Mar 13 2023 *)
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^2 / eta(x + A), n))}; /* Michael Somos, Mar 14 2011 */
    
  • PARI
    {a(n) = issquare( 8*n + 1)}; /* Michael Somos, Apr 27 2000 */
    
  • PARI
    a(n) = ispolygonal(n, 3); \\ Michel Marcus, Jan 22 2015
    
  • Python
    from sympy import integer_nthroot
    def A010054(n): return int(integer_nthroot((n<<3)+1,2)[1]) # Chai Wah Wu, Nov 15 2022
    
  • Sage
    # uses[EulerTransform from A166861]
    b = BinaryRecurrenceSequence(-1, 0)
    a = EulerTransform(b)
    print([a(n) for n in range(88)]) # Peter Luschny, Nov 17 2022
    

Formula

Expansion of f(x, x^3) in powers of x where f(, ) is Ramanujan's general theta function.
Expansion of q^(-1) * (phi(q) - phi(q^4)) / 2 in powers of q^8. - Michael Somos, Jul 01 2014
Expansion of q^(-1/8) * eta(q^2)^2 / eta(q) in powers of q. - Michael Somos, Apr 13 2005
Euler transform of period 2 sequence [ 1, -1, ...]. - Michael Somos, Mar 24 2003
Given g.f. A(x), then B(q) = q * A(q^8) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u1*u6^3 + u2*u3^3 - u1*u2^2*u6. - Michael Somos, Apr 13 2005
a(n) = b(8*n + 1) where b()=A098108() is multiplicative with b(2^e) = 0^e, b(p^e) = (1 + (-1)^e) / 2 if p > 2. - Michael Somos, Jun 06 2005
a(n) = A005369(2*n). - Michael Somos, Apr 29 2003
G.f.: theta_2(sqrt(q)) / (2 * q^(1/8)).
G.f.: 1 / (1 - x / (1 + x / (1 + x^1 / (1 - x / (1 + x / (1 + x^2 / (1 - x / (1 + x / (1 + x^3 / ...))))))))). - Michael Somos, May 11 2012
G.f.: Product_{k>0} (1-x^(2*k))/(1-x^(2*k-1)). - Vladeta Jovovic, May 02 2002
a(0)=1; for n>0, a(n) = A002024(n+1)-A002024(n). - Benoit Cloitre, Jan 05 2004
G.f.: Sum_{j>=0} Product_{k=0..j} x^j. - Jon Perry, Mar 30 2004
a(n) = floor((1-cos(Pi*sqrt(8*n+1)))/2). - Carl R. White, Mar 18 2006
a(n) = round(sqrt(2n+1)) - round(sqrt(2n)). - Hieronymus Fischer, Aug 06 2007
a(n) = ceiling(2*sqrt(2n+1)) - floor(2*sqrt(2n)) - 1. - Hieronymus Fischer, Aug 06 2007
a(n) = f(n,0) with f(x,y) = if x > 0 then f(x-y,y+1), otherwise 0^(-x). - Reinhard Zumkeller, Sep 27 2008
a(n) = A035214(n) - 1.
From Mikael Aaltonen, Jan 22 2015: (Start)
Since the characteristic function of s-gonal numbers is given by floor(sqrt(2n/(s-2) + ((s-4)/(2s-4))^2) + (s-4)/(2s-4)) - floor(sqrt(2(n-1)/(s-2) + ((s-4)/(2s-4))^2) + (s-4)/(2s-4)), by setting s = 3 we get the following: For n > 0, a(n) = floor(sqrt(2*n+1/4)-1/2) - floor(sqrt(2*(n-1)+1/4)-1/2).
(End)
a(n) = (-1)^n * A106459(n). - Michael Somos, May 04 2016
G.f. is a period 1 Fourier series which satisfies f(-1 / (16 t)) = 2^(-1/2) (t/i)^(1/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A002448. - Michael Somos, May 05 2016
G.f.: Sum_{n >= 0} x^(n*(n+1)/2) = Product_{n >= 1} (1 - x^n)*(1 + x^n)^2 = Product_{n >= 1} (1 - x^(2*n))*(1 + x^n) = Product_{n >= 1} (1 - x^(2*n))/(1 - x^(2*n-1)). From the sum and product representations of theta_2(0, sqrt(q))/(2*q^(1/8)) function. The last product, given by Vladeta Jovovic above, is obtained from the second to last one by an Euler identity, proved via f(x) := Product_{n >= 1} (1 - x^(2*n-1))*Product_{n >= 1} (1 + x^n) = f(x^2), by moving the odd-indexed factors of the second product to the first product. This leads to f(x) = f(0) = 1. - Wolfdieter Lang, Jul 05 2016
a(0) = 1, a(n) = (1/n)*Sum_{k=1..n} A002129(k)*a(n-k) for n > 0. - Seiichi Manyama, Apr 08 2017
G.f.: Sum_{n >= 0} x^n * Product_{k >= n+1} (1 - x^(2*k)) = 1/(1 - x) * Sum_{n >= 0} x^(3*n) * Product_{k >= n+1} (1 - x^(2*k)) = 1/((1 - x)*(1 - x^3)) * Sum_{n >= 0} x^(5*n) * Product_{k >= n+1} (1 - x^(2*k)) = .... - Peter Bala, Jun 24 2025

Extensions

Additional comments from Michael Somos, Apr 27 2000

A010815 From Euler's Pentagonal Theorem: coefficient of q^n in Product_{m>=1} (1 - q^m).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

When convolved with the partition numbers A000041 gives 1, 0, 0, 0, 0, ...
Also, number of different partitions of n into parts of -1 different kinds (based upon formal analogy). - Michele Dondi (blazar(AT)lcm.mi.infn.it), Jun 29 2004
The comment that "when convolved with the partition numbers gives [1, 0, 0, 0, ...]" is equivalent to row sums of triangle A145975 = [1, 0, 0, 0, ...]; where A145975 is a partition number convolution triangle. - Gary W. Adamson, Oct 25 2008
When convolved with n-th partial sums of A000041 = the binomial sequence starting (1, n, ...). Example: A010815 convolved with A014160 (partial sum operation applied thrice to the partition numbers) = (1, 3, 6, 10, ...). - Gary W. Adamson, Nov 11 2008
(A000012^(-n) * A000041) convolved with A010815 = n-th row of the inverse of Pascal's triangle, (as a vector, followed by zeros); where A000012^(-1) = the pairwise difference operator. Example: (A000012^(-4) * A000041) convolved with A010815 = (1, -4, 6, -4, 1, 0, 0, 0, ...). - Gary W. Adamson, Nov 11 2008
Also sum of [product of (1-2/(hook lengths)^2)] over all partitions of n. - Wouter Meeussen, Sep 16 2010
Cayley (1895) begins article 387 with "Write for shortness sqrt(2k'K / pi) / [1-q^{2m-1}]^2 = G, ..." which is a convoluted way of writing G = [1-q^{2m}] = (1-q^2)(1-q^4)... - Michael Somos, Aug 01 2011
This is an example of the quintuple product identity in the form f(a*b^4, a^2/b) - (a/b) * f(a^4*b, b^2/a) = f(-a*b, -a^2*b^2) * f(-a/b, -b^2) / f(a, b) where a = x^3, b = x. - Michael Somos, Jan 21 2012
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Number 1 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 - x - x^2 + x^5 + x^7 - x^12 - x^15 + x^22 + x^26 - x^35 - x^40 + ...
G.f. = q - q^25 - q^49 + q^121 + q^169 - q^289 - q^361 + q^529 + q^625 + ...
From _Seiichi Manyama_, Mar 04 2017: (Start)
G.f.
= 1 + (-x - 3*x^2/2 - 4*x^3/3 -  7*x^4/4  -  6*x^5/5 - ...)
     + 1/2 * (x^2   + 3*x^3   + 59*x^4/12 + 15*x^5/2 + ...)
              + 1/6 * (-x^3   -  9*x^4/2  - 43*x^5/4 - ...)
                         + 1/24 * (x^4    +  6*x^5   + ...)
                                   + 1/120 * (-x^5   - ...)
                                             + ...
= 1 - x - x^2 + x^5 + .... (End)
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, Tenth Printing, 1972, p. 825.
  • B. C. Berndt, Ramanujan's theory of theta-functions, Theta functions: from the classical to the modern, Amer. Math. Soc., Providence, RI, 1993, pp. 1-63. MR 94m:11054. See page 3.
  • T. J. I'a. Bromwich, Introduction to the Theory of Infinite Series, Macmillan, 2nd. ed. 1949, p. 116, Problem 18.
  • A. Cayley, An Elementary Treatise on Elliptic Functions, G. Bell and Sons, London, 1895, p. 295, Art. 387.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 104, [5g].
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 77, Eq. (32.12) and (32.13).
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 86.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Theorem 353.
  • B. Schoeneberg, Elliptic Modular Functions, Springer-Verlag, NY, 1974, p. 70.
  • A. Weil, Number theory: an approach through history; from Hammurapi to Legendre, Birkhäuser, Boston, 1984; see p. 186.

Crossrefs

Programs

  • Julia
    # DedekindEta is defined in A000594.
    A010815List(len) = DedekindEta(len, 1)
    A010815List(93) |> println # Peter Luschny, Mar 09 2018
    
  • Julia
    function A010815(n)
        r = 24 * n + 1
        m = isqrt(r)
        m * m != r && return 0
        iseven(div(m + m % 6, 6)) ? 1 : -1
    end # Peter Luschny, Sep 09 2021
  • Magma
    Coefficients(&*[1-x^m:m in [1..100]])[1..100] where x is PolynomialRing(Integers()).1; // Vincenzo Librandi, Jan 15 2017
    
  • Maple
    A010815 := mul((1-x^m), m=1..100);
    A010815 := proc(n) local x,m;
        product(1-x^m,m=1..n) ;
        expand(%) ;
        coeff(%,x,n) ;
    end proc: # R. J. Mathar, Jun 18 2016
    A010815 := proc(n) 24*n + 1; if issqr(%) then sqrt(%);
    (-1)^irem(iquo(% + irem(%, 6), 6), 2) else 0 fi end: # Peter Luschny, Oct 02 2022
  • Mathematica
    a[ n_] := SeriesCoefficient[ Product[ 1 - x^k, {k, n}], {x, 0, n}]; (* Michael Somos, Nov 15 2011 *)
    a[ n_] := If[ n < 0, 0, SeriesCoefficient[ (Series[ EllipticTheta[ 3, Log[y] / (2 I), x^(3/2)], {x, 0, n + Floor@Sqrt[n]}] // Normal // TrigToExp) /. {y -> -x^(1/2)}, {x, 0, n}]]; (* Michael Somos, Nov 15 2011 *)
    CoefficientList[ Series[ Product[(1 - x^k), {k, 1, 70}], {x, 0, 70}], x]
    (* hooklength[ ] cfr A047874 *) Table[ Tr[ ( Times@@(1-2/Flatten[hooklength[ # ]]^2) )&/@ Partitions[n] ],{n,26}] (* Wouter Meeussen, Sep 16 2010 *)
    CoefficientList[ Series[ QPochhammer[q], {q, 0, 100}], q] (* Jean-François Alcover, Dec 04 2013 *)
    a[ n_] := With[ {m = Sqrt[24 n + 1]}, If[ IntegerQ[m], KroneckerSymbol[ 12, m], 0]]; (* Michael Somos, Jun 04 2015 *)
    nmax = 100; poly = ConstantArray[0, nmax + 1]; poly[[1]] = 1; poly[[2]] = -1; Do[Do[poly[[j + 1]] -= poly[[j - k + 1]], {j, nmax, k, -1}];, {k, 2, nmax}]; poly (* Vaclav Kotesovec, May 04 2018 *)
    Table[m = (1 + Sqrt[1 + 24*k])/6; If[IntegerQ[m], (-1)^m, 0] + If[IntegerQ[m - 1/3], (-1)^(m - 1/3), 0], {k, 0, 100}] (* Vaclav Kotesovec, Jul 09 2020 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( eta(x + x * O(x^n)), n))}; /* Michael Somos, Jun 05 2002 */
    
  • PARI
    {a(n) = polcoeff( prod( k=1, n, 1 - x^k, 1 + x * O(x^n)), n)}; /* Michael Somos, Nov 19 2011 */
    
  • PARI
    {a(n) = if( issquare( 24*n + 1, &n), kronecker( 12, n))}; /* Michael Somos, Feb 26 2006 */
    
  • PARI
    {a(n) = if( issquare( 24*n + 1, &n), if( (n%2) && (n%3), (-1)^round( n/6 )))}; /* Michael Somos, Feb 26 2006 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = 1 + O(x^n); polcoeff( sum( k=1, (sqrtint( 8*n + 1)-1) \ 2, A *= x^k / (x^k - 1) + x * O(x^(n - (k^2-k)/2)), 1), n))}; /* Michael Somos, Aug 18 2006 */
    
  • PARI
    lista(nn) = {q='q+O('q^nn); Vec(eta(q))} \\ Altug Alkan, Mar 21 2018
    
  • Python
    from math import isqrt
    def A010815(n):
        m = isqrt(24*n+1)
        return 0 if m**2 != 24*n+1 else ((-1)**((m-1)//6) if m % 6 == 1 else (-1)**((m+1)//6)) # Chai Wah Wu, Sep 08 2021
    

Formula

a(n) = (-1)^m if n is of the form m(3m+-1)/2; otherwise a(n)=0. The values of n such that |a(n)|=1 are the generalized pentagonal numbers, A001318. The values of n such that a(n)=0 is A090864.
Expansion of the Dedekind eta function without the q^(1/24) factor in powers of q.
Euler transform of period 1 sequence [ -1, -1, -1, ...].
G.f.: (q; q){oo} = Product{k >= 1} (1-q^k) = Sum_{n=-oo..oo} (-1)^n*q^(n*(3n+1)/2). The first notation is a q-Pochhammer symbol.
Expansion of f(-x) := f(-x, -x^2) in powers of x. A special case of Ramanujan's general theta function; see Berndt reference. - Michael Somos, Apr 08 2003
a(n) = A067661(n) - A067659(n). - Jon Perry, Jun 17 2003
Expansion of f(x^5, x^7) - x * f(x, x^11) in powers of x where f(, ) is Ramanujan's general theta function. - Michael Somos, Jan 21 2012
G.f.: q^(-1/24) * eta(t), where q = exp(2 Pi i t) and eta is the Dedekind eta function.
G.f.: 1 - x - x^2(1-x) - x^3(1-x)(1-x^2) - ... - Jon Perry, Aug 07 2004
Given g.f. A(x), then B(q) = q * A(q^3)^8 satisfies 0 = f(B(q), B(q^2), B(q^4)) where f(u, v, w) = u^2*w - v^3 + 16*u*w^2. - Michael Somos, May 02 2005
Given g.f. A(x), then B(q) = q * A(q^24) satisfies 0 = f(B(q), B(x^q), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u1^9*u3*u6^3 - u2^9*u3^4 + 9*u1^4*u2*u6^8. - Michael Somos, May 02 2005
a(n) = b(24*n + 1) where b() is multiplicative with b(p^2e) = (-1)^e if p == 5 or 7 (mod 12), b(p^2e) = +1 if p == 1 or 11 (mod 12) and b(p^(2e-1)) = b(2^e) = b(3^e) = 0 if e>0. - Michael Somos, May 08 2005
Given g.f. A(x), then B(q) = q * A(q^24) satisfies 0 = f(B(q), B(q^2), B(q^4)) where f(u, v, w) = u^16*w^8 - v^24 + 16*u^8*w^16. - Michael Somos, May 08 2005
a(n) = (-1)^n * A121373(n). a(25*n + 1) = -a(n). a(5*n + 3) = a(5*n + 4) = 0. a(5*n) = A113681(n). a(5*n + 2) = - A116915(n). - Michael Somos, Feb 26 2006
G.f.: 1 + Sum_{k>0} (-1)^k * x^((k^2 + k) / 2) / ((1 - x) * (1 - x^2) * ... * (1 - x^k)). - Michael Somos, Aug 18 2006
a(n) = -(1/n)*Sum_{k=1..n} sigma(k)*a(n-k). - Vladeta Jovovic, Aug 28 2002
G.f.: A(x) = 1 - x/G(0); G(k) = 1 + x - x^(k+1) - x*(1-x^(k+1))/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Jan 25 2012
Expansion of f(-x^2) * chi(-x) = psi(-x) * chi(-x^2) = psi(x) * chi(-x)^2 = f(-x^2)^2 / psi(x) = phi(-x) / chi(-x) = phi(-x^2) / chi(x) in powers of x where phi(), psi(), chi(), f() are Ramanujan theta functions. - Michael Somos, Nov 16 2015
G.f.: exp( Sum_{n>=1} -sigma(n)*x^n/n ). - Seiichi Manyama, Mar 04 2017
G.f.: Sum_{n >= 0} x^(n*(2*n-1))*(2*x^(2*n) - 1)/Product_{k = 1..2*n} 1 - x^k. - Peter Bala, Feb 02 2021
The g.f. A(x) satisfies A(x^2) = Sum_{n >= 0} x^(n*(n+1)/2) * Product_{k >= n+1} 1 - x^k = 1 - x^2 - x^4 + x^10 + x^14 - x^24 - x^30 + + - - .... - Peter Bala, Feb 12 2021
For m >= 0, A(x) = (1 - x)*(1 - x^2)*...*(1 - x^m) * Sum_{n >= 0} (-1)^n * x^(n*(n+2*m+1)/2) /(Product_{k = 1..n} 1 - x^k). - Peter Bala, Feb 03 2025
From Friedjof Tellkamp, Mar 19 2025: (Start)
Sum_{n>=1} a(n)/n = 6 - 4*Pi/sqrt(3).
Sum_{n>=1} a(n)/n^2 = -108 + 16*sqrt(3)*Pi + 2*Pi^2.
Sum_{n>=1} a(n)/n^k = Sum_{i=0..k} 6^(k-i)*C(-k, k-i)*A(i), where A(i)=(2^i-2)*(3^i-3)*zeta(i) for even i, and A(i)=-G(i/2-1/2)*(2^i+2)*(2*Pi)^i/(sqrt(3)*Gamma(i+1)) for odd i, with G(n>0) as the Glaisher's numbers (A002111) and G(0)=1/2. (End)

Extensions

Additional comments from Michael Somos, Jun 05 2002

A121373 Expansion of f(x) = f(x, -x^2) in powers of x where f(, ) is Ramanujan's general theta function.

Original entry on oeis.org

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

Views

Author

Michael Somos, Jul 24 2006

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
This is an example of the quintuple product identity in the form f(a*b^4, a^2/b) - (a/b) * f(a^4*b, b^2/a) = f(-a*b, -a^2*b^2) * f(-a/b, -b^2) / f(a, b) where a = -x^3, b = -x. - Michael Somos, Jul 11 2012
Number 5 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 + x - x^2 - x^5 - x^7 - x^12 + x^15 + x^22 + x^26 + x^35 + ...
G.f. = q + q^25 - q^49 - q^121 - q^169 - q^289 + q^361 + q^529 + ...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := SeriesCoefficient[ Product[ 1 - (-x)^k, {k, n}], {x, 0, n}]; (* Michael Somos, Nov 14 2011 *)
    a[ n_] := SeriesCoefficient[ QPochhammer[ -x], {x, 0, n}]; (* Michael Somos, Jul 06 2013 *)
    a[ n_] := SeriesCoefficient[ (EllipticTheta[ 1, Pi/12, x^4] + EllipticTheta[ 2, Pi/12, x^4]) / Sqrt[6], {x, 0, 24 n + 1}] // Simplify; (* Michael Somos, Mar 20 2015 *)
  • PARI
    {a(n) = if( issquare( 24*n + 1, &n), kronecker( 6, n))};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( eta( -x + x * O(x^n)), n))};

Formula

Expansion of q^(-1/4) * (theta_1( Pi/12, q) + theta_2( Pi/12, q)) / sqrt(6) in powers of q^6. - Michael Somos, Jul 06 2013
Expansion of q^(-1/24) * eta(q^2)^3 / (eta(q) * eta(q^4)) in powers of q.
Euler transform of period 4 sequence [1, -2, 1, -1, ...].
a(n) = b(24*n + 1) where b() is multiplicative with b(p^2e) = (-1)^e if p == 7, 11, 13, 17 (mod 24), b(p^2e) = +1 if p == 1, 5, 19, 23 (mod 24) and b(p^(2e-1)) = b(2^e) = b(3^e) = 0 if e>0.
G.f.: (1 + x) * (1 - x^2) * (1 + x^3) * (1 - x^4) * ...
G.f.: 1 + x - x^2*(1 + x) + x^3*(1 + x)*(1 - x^2) - x^4*(1 + x)*(1 - x^2)*(1 + x^3) + ...
a(5*n + 3) = a(5*n + 4) = 0. a(25*n + 1) = a(n).
G.f.: Sum_{k>=0} a(k) * x^(24*k + 1) = Sum_{k in Z} (-1)^floor((k+1)/2) * x^(6*k + 1)^2.
a(n) = (-1)^n * A010815(n). |a(n)| = A080995(n).
Expansion of f(-x^5, -x^7) + x * f(-x, -x^11) in powers of x. - Michael Somos, Jan 10 2015
G.f. is a period 1 Fourier series which satisfies f(-1 / (2304 t)) = 48^(1/2) (t/i)^(1/2) f(t) where q = exp(2 Pi i t). - Michael Somos, May 05 2016
G.f.: exp(Sum_{k>=1} (-1)^(k+1)*x^k/(k*(1 - (-x)^k))). - Ilya Gutkovskiy, Jun 08 2018

A010052 Characteristic function of squares: a(n) = 1 if n is a square, otherwise 0.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Keywords

Comments

Also parity of the divisor function A000005 if n >= 1. - Omar E. Pol, Jan 14 2012
This sequence can be considered as k=1 analog of A025426 (k=2), A025427 (k=3), A025428 (k=4); see also A000161. - M. F. Hasler, Jan 25 2013
Also, the decimal expansion of Sum_{n >= 0} 1/(10^n)^n. - Eric Desbiaux, Mar 15 2009, rephrased and simplified by M. F. Hasler, Jan 26 2013
Run lengths of zeros gives A005843, the nonnegative even numbers. - Jeremy Gardiner, Jan 14 2018
Inverse Möbius transform of Liouville's lambda function (A008836), n >= 1. - Wesley Ivan Hurt, Jun 22 2024

Examples

			G.f. = 1 + x + x^4 + x^9 + x^16 + x^25 + x^36 + x^49 + x^64 + x^81 + ...
		

References

  • Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, pp. 3-4, also p. 166, Ex. 5.5.1.
  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, Problem 20.
  • Richard Bellman, A Brief Introduction to Theta Functions, Dover, 2013 (11.14).
  • Michael D. Hirschhorn, The Power of q, Springer, 2017. See phi(q) page 8.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
  • Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002, p. 55.

Crossrefs

Column k=1 of A243148, A337165, A341040 (for n>0).
Cf. A000005, A000122, A005369, A007913, A008836 (Mobius transf.), A037011, A063524, A258998, A271102 (Dirichlet inv), A046951 (inv. Mobius trans.).
First differences of A000196.

Programs

  • Haskell
    a010052 n = fromEnum $ a000196 n ^ 2 == n
    -- Reinhard Zumkeller, Jan 26 2012, Feb 20 2011
    a010052_list = concat (iterate (\xs -> xs ++ [0,0]) [1])
    -- Reinhard Zumkeller, Apr 27 2012
    
  • Maple
    readlib(issqr): f := i->if issqr(i) then 1 else 0; fi; [ seq(f(i),i=0..100) ];
  • Mathematica
    lst = {}; Do[AppendTo[lst, 2*Sum[Floor[n/k] - Floor[(n - 1)/k], {k, Floor[Sqrt[n]]}] - DivisorSigma[0, n]], {n, 93}]; Prepend[lst, 1] (* Eric Desbiaux, Jan 29 2012 *)
    Table[If[IntegerQ[Sqrt[n]],1,0],{n,0,100}] (* Harvey P. Dale, Jul 19 2014 *)
    a[n_] := SeriesCoefficient[1/(1 - q)* QHypergeometricPFQ[{-q, -q}, {-(q^2)}, -q, -q], {q, 0, Abs@n}] (* Mats Granvik, Jan 01 2016 *)
    Range[0, 120] /. {n_ /; IntegerQ@ Sqrt@ n -> 1, n_ /; n != 1 -> 0} (* Michael De Vlieger, Jan 02 2016 *)
    a[n_] := Sum[If[Mod[n, k] == 0, Re[Sqrt[LiouvilleLambda[k]]*Sqrt[LiouvilleLambda[n/k]]], 0], {k, 1, n}] (* Mats Granvik, Aug 10 2018 *)
  • PARI
    {a(n) = issquare(n)};
    
  • PARI
    a(n)=if(n<1,1,sumdiv(n,d,(-1)^bigomega(d))) \\ Benoit Cloitre, Oct 25 2009
    
  • PARI
    a(n) = if (n<1, 1, direuler( p=2, n, 1/ (1 - X^2 ))[n]); \\ Michel Marcus, Mar 08 2015
    
  • Python
    def A010052(n): return int(math.isqrt(n)**2==n) ##  appears to be faster than sympy.ntheory.primetest.is_square, up to 10^8 at least.
    # M. F. Hasler, Mar 21 2022
  • Scheme
    (define (A010052 n) (if (zero? n) 1 (- (A000196 n) (A000196 (- n 1))))) ;; (For the definition of A000196, see under that entry). - Antti Karttunen, Nov 03 2017
    

Formula

a(n) = floor(sqrt(n)) - floor(sqrt(n-1)), for n > 0.
a(n) = A000005(n) mod 2, n > 0. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 19 2001
G.f. A(x) satisfies: 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = (u-w)^2 - (v-w)*(v+w-1) - Michael Somos, Jul 19 2004
Dirichlet g.f.: zeta(2s). - Franklin T. Adams-Watters, Sep 11 2005
G.f.: (theta_3(0,x) + 1)/2, where theta_3 is a Jacobi theta function. - Franklin T. Adams-Watters, Jun 19 2006 [See A000122 for theta_3.]
a(n) = f(n,0) with f(x,y) = f(x-2*y-1,y+1) if x > 0, otherwise 0^(-x). - Reinhard Zumkeller, Sep 26 2008
a(n) = Sum_{d|n} (-1)^bigomega(d), for n >= 1. - Benoit Cloitre, Oct 25 2009
a(n) <= A093709(n). - Reinhard Zumkeller, Nov 14 2009
a(A000290(n)) = 1; a(A000037(n)) = 0. - Reinhard Zumkeller, Jun 20 2011
a(n) = 0 ^ A053186(n). - Reinhard Zumkeller, Feb 12 2012
a(n) = A063524(A007913(n)), for n > 0. - Reinhard Zumkeller, Jul 09 2014
a(n) = -(-1)^n * A258998(n) unless n = 0. 2 * a(n) = A000122(n) unless n = 0. - Michael Somos, Jun 16 2015
a(n) = A037011(A156552(n)), provided that A037011(n) = A000035(A106737(n)). [See A037011.] - Antti Karttunen, Nov 03 2017
a(n*m) = a(n/gcd(n,m))*a(m/gcd(n,m)) for all n and m > 0 (conjectured). - Velin Yanev, Feb 13 2019 [Proof from Michael B. Porter, Feb 16 2019: If nm is a square, nm = product_i (p_i^2), where p_i are prime, not necessarily distinct. Each p_i either appears twice in n, twice in m, or one time in each and therefore in the gcd. So n/gcd(n,m) and m/gcd(n,m) are both squares. If nm is not a square, there is a q_j that appears in one of n or m but not in the gcd. So either n/gcd(n,m) or m/gcd(n,m) is not a square.]
a(n) = Sum_{d|n} A008836(d), n >= 1, a(0) = 1. - Jinyuan Wang, Apr 20 2019
G.f.: A(q) = Sum_{n >= 0} q^(2*n)*Product_{k >= 2*n+1} 1 - (-q)^k. - Peter Bala, Feb 22 2021
Multiplicative with a(p^e) = 1 if e is even, and 0 otherwise. - Amiram Eldar, Dec 29 2022
a(n) = Sum_{d|n} mobius(core(n)), where core(n) = A007913(n). - Peter Bala, Jan 24 2024

Extensions

More terms from Franklin T. Adams-Watters, Jun 19 2006

A004016 Theta series of planar hexagonal lattice A_2.

Original entry on oeis.org

1, 6, 0, 6, 6, 0, 0, 12, 0, 6, 0, 0, 6, 12, 0, 0, 6, 0, 0, 12, 0, 12, 0, 0, 0, 6, 0, 6, 12, 0, 0, 12, 0, 0, 0, 0, 6, 12, 0, 12, 0, 0, 0, 12, 0, 0, 0, 0, 6, 18, 0, 0, 12, 0, 0, 0, 0, 12, 0, 0, 0, 12, 0, 12, 6, 0, 0, 12, 0, 0, 0, 0, 0, 12, 0, 6, 12, 0, 0, 12, 0
Offset: 0

Views

Author

Keywords

Comments

The hexagonal lattice is the familiar 2-dimensional lattice in which each point has 6 neighbors. This is sometimes called the triangular lattice.
a(n) is the number of integer solutions to x^2 + x*y + y^2 = n (or equivalently x^2 - x*y + y^2 = n). - Michael Somos, Sep 20 2004
a(n) is the number of integer solutions to x^2 + y^2 + z^2 = 2*n where x + y + z = 0. - Michael Somos, Mar 12 2012
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Cubic AGM theta functions: a(q) (the present sequence), b(q) (A005928), c(q) (A005882).
a(n) = 6*A002324(n) if n>0, and A002324 is multiplicative, thus a(1)*a(m*n) = a(n)*a(m) if n>0, m>0 are relatively prime. - Michael Somos, Mar 17 2019
The first occurrence of a(n)= 6, 12, 18, 24, ... (multiples of 6) is at n= 1, 7, 49, 91, 2401, 637, 117649, ... (see A002324). - R. J. Mathar, Sep 21 2024

Examples

			G.f. = 1 + 6*x + 6*x^3 + 6*x^4 + 12*x^7 + 6*x^9 + 6*x^12 + 12*x^13 + 6*x^16 + ...
Theta series of A_2 on the standard scale in which the minimal norm is 2:
1 + 6*q^2 + 6*q^6 + 6*q^8 + 12*q^14 + 6*q^18 + 6*q^24 + 12*q^26 + 6*q^32 + 12*q^38 + 12*q^42 + 6*q^50 + 6*q^54 + 12*q^56 + 12*q^62 + 6*q^72 + 12*q^74 + 12*q^78 + 12*q^86 + 6*q^96 + 18*q^98 + 12*q^104 + 12*q^114 + 12*q^122 + 12*q^126 + 6*q^128 + 12*q^134 + 12*q^146 + 6*q^150 + 12*q^152 + 12*q^158 + ...
		

References

  • B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 171, Entry 28.
  • Harvey Cohn, Advanced Number Theory, Dover Publications, Inc., 1980, p. 89. Ex. 18.
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 111.
  • M. N. Huxley, Area, Lattice Points and Exponential Sums, Oxford, 1996; p. 236.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See also A035019.
Cf. A000007, A000122, A004015, A008444, A008445, A008446, A008447, A008448, A008449 (Theta series of lattices A_0, A_1, A_3, A_4, ...), A186706.

Programs

  • Magma
    Basis( ModularForms( Gamma1(3), 1), 81) [1]; /* Michael Somos, May 27 2014 */
    
  • Magma
    L := Lattice("A",2); A := ThetaSeries(L, 161); A; /* Michael Somos, Nov 13 2014 */
    
  • Maple
    A004016 := proc(n)
        local a,j ;
        a := A033716(n) ;
        for j from 0 to n/3 do
            a := a+A089800(n-1-3*j)*A089800(j) ;
        end do:
        a;
    end proc:
    seq(A004016(n),n=0..49) ; # R. J. Mathar, Feb 22 2021
  • Mathematica
    a[ n_] := If[ n < 1, Boole[ n == 0 ], 6 DivisorSum[ n, KroneckerSymbol[ #, 3] &]]; (* Michael Somos, Nov 08 2011 *)
    a[ n_] := SeriesCoefficient[ (QPochhammer[ q]^3 + 9 q QPochhammer[ q^9]^3) / QPochhammer[ q^3], {q, 0, n}]; (* Michael Somos, Nov 13 2014 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q] EllipticTheta[ 3, 0, q^3] + EllipticTheta[ 2, 0, q] EllipticTheta[ 2, 0, q^3], {q, 0, n}]; (* Michael Somos, Nov 13 2014 *)
    a[ n_] := Length @ FindInstance[ x^2 + x y + y^2 == n, {x, y}, Integers, 10^9]; (* Michael Somos, Sep 14 2015 *)
    terms = 81; f[q_] = LatticeData["A2", "ThetaSeriesFunction"][-I Log[q]/Pi]; s = Series[f[q], {q, 0, 2 terms}]; CoefficientList[s, q^2][[1 ;; terms]] (* Jean-François Alcover, Jul 04 2017 *)
  • PARI
    {a(n) = my(A, p, e); if( n<1, n==0, A = factor(n); 6 * prod( k=1, matsize(A)[1], [p, e] = A[k, ]; if( p==3, 1, p%3==1, e+1, 1-e%2)))}; /* Michael Somos, May 20 2005 */ /* Editor's note: this is the most efficient program */
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( 1 + 6 * sum( k=1,n, x^k / (1 + x^k + x^(2*k)), x * O(x^n)), n))}; /* Michael Somos, Oct 06 2003 */
    
  • PARI
    {a(n) = if( n<1, n==0, 6 * sumdiv( n,d, kronecker( d, 3)))}; /* Michael Somos, Mar 16 2005 */
    
  • PARI
    {a(n) = if( n<1, n==0, 6 * sumdiv( n,d, (d%3==1) - (d%3==2)))}; /* Michael Somos, May 20 2005 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, n*=3; A = x * O(x^n); polcoeff( (eta(x + A)^3  + 3 * x * eta(x^9 + A)^3) / eta(x^3 + A), n))}; /* Michael Somos, May 20 2005 */
    
  • PARI
    {a(n) = if( n<1, n==0, qfrep([ 2, 1; 1, 2], n, 1)[n] * 2)}; /* Michael Somos, Jul 16 2005 */
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( 1 + 6 * sum( k=1, n, x^(3*k - 2) / (1 - x^(3*k - 2)) - x^(3*k - 1) / (1 - x^(3*k - 1)), x * O(x^n)), n))} /* Paul D. Hanna, Jul 03 2011 */
    
  • Python
    from math import prod
    from sympy import factorint
    def A004016(n): return 6*prod(e+1 if p%3==1 else int(not e&1) for p, e in factorint(n).items() if p != 3) if n else 1 # Chai Wah Wu, Nov 17 2022
  • Sage
    ModularForms( Gamma1(3), 1, prec=81).0 ; # Michael Somos, Jun 04 2013
    

Formula

Expansion of a(q) in powers of q where a(q) is the first cubic AGM theta function.
Expansion of theta_3(q) * theta_3(q^3) + theta_2(q) * theta_2(q^3) in powers of q.
Expansion of phi(x) * phi(x^3) + 4 * x * psi(x^2) * psi(x^6) in powers of x where phi(), psi() are Ramanujan theta functions.
Expansion of (1 / Pi) integral_{0 .. Pi/2} theta_3(z, q)^3 + theta_4(z, q)^3 dz in powers of q^2. - Michael Somos, Jan 01 2012
Expansion of coefficient of x^0 in f(x * q, q / x)^3 in powers of q^2 where f(,) is Ramanujan's general theta function. - Michael Somos, Jan 01 2012
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = u^2 - 3*v^2 - 2*u*w + 4*w^2. - Michael Somos, Jun 11 2004
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^3), A(x^6)) where f(u1, u2, u3, u6) = (u1-u3) * (u3-u6) - (u2-u6)^2. - Michael Somos, May 20 2005
G.f. is a period 1 Fourier series which satisfies f(-1 / (3 t)) = 3^(1/2) (t/i) f(t) where q = exp(2 Pi i t). - Michael Somos, Sep 11 2007
G.f. A(x) satisfies A(x) + A(-x) = 2 * A(x^4), from Ramanujan.
G.f.: 1 + 6 * Sum_{k>0} x^k / (1 + x^k + x^(2*k)). - Michael Somos, Oct 06 2003
G.f.: Sum_( q^(n^2+n*m+m^2) ) where the sum (for n and m) extends over the integers. - Joerg Arndt, Jul 20 2011
G.f.: theta_3(q) * theta_3(q^3) + theta_2(q) * theta_2(q^3) = (eta(q^(1/3))^3 + 3 * eta(q^3)^3) / eta(q).
G.f.: 1 + 6*Sum_{n>=1} x^(3*n-2)/(1-x^(3*n-2)) - x^(3*n-1)/(1-x^(3*n-1)). - Paul D. Hanna, Jul 03 2011
a(3*n + 2) = 0, a(3*n) = a(n), a(3*n + 1) = 6 * A033687(n). - Michael Somos, Jul 16 2005
a(2*n + 1) = 6 * A033762(n), a(4*n + 2) = 0, a(4*n) = a(n), a(4*n + 1) = 6 * A112604(n), a(4*n + 3) = 6 * A112595(n). - Michael Somos, May 17 2013
a(n) = 6 * A002324(n) if n>0. a(n) = A005928(3*n).
Euler transform of A192733. - Michael Somos, Mar 12 2012
a(n) = (-1)^n * A180318(n). - Michael Somos, Sep 14 2015
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2*Pi/sqrt(3) = 3.627598... (A186706). - Amiram Eldar, Oct 15 2022

A005882 Theta series of planar hexagonal lattice (A2) with respect to deep hole.

Original entry on oeis.org

3, 3, 6, 0, 6, 3, 6, 0, 3, 6, 6, 0, 6, 0, 6, 0, 9, 6, 0, 0, 6, 3, 6, 0, 6, 6, 6, 0, 0, 0, 12, 0, 6, 3, 6, 0, 6, 6, 0, 0, 3, 6, 6, 0, 12, 0, 6, 0, 0, 6, 6, 0, 6, 0, 6, 0, 9, 6, 6, 0, 6, 0, 0, 0, 6, 9, 6, 0, 0, 6, 6, 0, 12, 0, 6, 0, 6, 0, 0, 0, 6, 6, 12, 0, 0, 3, 12, 0, 0, 6, 6, 0, 6, 0, 6, 0, 3, 6, 0, 0, 12
Offset: 0

Views

Author

Keywords

Comments

The hexagonal lattice is the familiar 2-dimensional lattice in which each point has 6 neighbors. This is sometimes called the triangular lattice.
Cubic AGM theta functions: a(q) (see A004016), b(q) (A005928), c(q) (A005882).
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
On page 111 of Conway and Sloane is "If the origin is moved to a deep hole the theta series is Theta_{hex+[1]}(z) = theta_2(z) psi_6(3z) + theta_3(z) psi_3(3z) = 3 q^{1/3} + 3 q^{4/3} + 6 q^{7/3} + 6 q^{13/3} + ... (63)" where the psi_k() for integer k is defined on page 103 equation (11) as psi_k(z) = e^{Pi i/z^2} theta_3(Pi z/k | z) = Sum_{m in Z} q^{(m + 1/k)^2}. - Michael Somos, Sep 10 2018

Examples

			G.f. = 3 + 3*x + 6*x^2 + 6*x^4 + 3*x^5 + 6*x^6 + 3*x^8 + 6*x^9 + 6*x^10 + ...
G.f. = 3*q + 3*q^4 + 6*q^7 + 6*q^13 + 3*q^16 + 6*q^19 + 3*q^25 + 6*q^28 + ...
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 111.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Essentially same as A033685 and A033687.

Programs

  • Magma
    Basis( ModularForms( Gamma1(9), 1), 302)[2] * 3; /* Michael Somos, Jul 19 2014 */
  • Mathematica
    a[ n_] := SeriesCoefficient[ 3 QPochhammer[ q^3]^3 / QPochhammer[ q], {q, 0, n}]; (* Michael Somos, Jul 19 2014 *)
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( 3 * eta(x^3 + A)^3 / eta(x + A), n))}; /* Michael Somos, Aug 15 2006 */
    

Formula

Expansion of q^(-1/3) * 3 * eta(q^3)^3 / eta(q) in powers of q.
Expansion of q^(-1/3) * c(q) in powers of q where c(q) is the third cubic AGM theta function.
Given g.f. A(x), then B(x) = x*A(x^3) satisfies 0 = f(B(x), B(x^2), B(x^4)) where f(u, v, w) = v^3 + 2*u*w^2 - u^2*w. - Michael Somos, Aug 15 2006
G.f.: 3 Product_{k>0} (1-q^(3k))^3/(1-q^k).
G.f.: Sum_{u,v in Z} x^(u*u + u*v + v*v + u + v). - Michael Somos, Jul 19 2014
a(n) = 3 * A033687(n). a(n) = A113062(3*n + 1) = A033685(3*n + 1).
Expansion of 2 * psi(x^2) * f(x^2, x^4) + phi(x) * f(x^1, x^5) in powers of x where phi(), psi() are Ramanujan theta functions and f(, ) is Ramanujan's general theta function. - Michael Somos, Sep 07 2018
Sum_{k=1..n} a(k) ~ 2*Pi*n/sqrt(3). - Vaclav Kotesovec, Dec 17 2022

A000118 Number of ways of writing n as a sum of 4 squares; also theta series of four-dimensional cubic lattice Z^4.

Original entry on oeis.org

1, 8, 24, 32, 24, 48, 96, 64, 24, 104, 144, 96, 96, 112, 192, 192, 24, 144, 312, 160, 144, 256, 288, 192, 96, 248, 336, 320, 192, 240, 576, 256, 24, 384, 432, 384, 312, 304, 480, 448, 144, 336, 768, 352, 288, 624, 576, 384, 96, 456, 744, 576, 336, 432, 960, 576, 192
Offset: 0

Views

Author

Keywords

Comments

a^2 + b^2 + c^2 + d^2 is one of Ramanujan's 54 universal quaternary quadratic forms. - Michael Somos, Apr 01 2008
a(n) is also the number of quaternions q = a + bi + cj + dk, where a, b, c, d are integers, such that a^2 + b^2 + c^2 + d^2 = n (i.e., so that n is the norm of q). These are Lipschitz integer quaternions. - Rick L. Shepherd, Mar 27 2009
Number 5 and 35 of the 126 eta-quotients listed in Table 1 of Williams 2012. - Michael Somos, Nov 10 2018
This is the convolution square of A004018. - Pierre Abbat, May 15 2023

Examples

			G.f. = 1 + 8*q + 24*q^2 + 32*q^3 + 24*q^4 + 48*q^5 + 96*q^6 + 64*q^7 + 24*q^8 + ...
a(1)=8 counts 1 = 1^2 + 0^2 + 0^2 + 0^2 = 0^2 + 1^2 + 0^2 + 0^2 = 0^2 + 0^2 + 1^2 + 0^2 = 0^2 + 0^2 + 0^2 + 1^2 and 4 more sums where 1^2 is replaced by (-1)^2. - _R. J. Mathar_, May 16 2023
		

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996, ch. 8, pp. 231-2.
  • J. H. Conway and N. J. A. Sloane, Sphere Packing, Lattices and Groups, Springer-Verlag, p. 108, Eq. (49).
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 78, Eq. (32.28). See also top of p. 94.
  • E. Freitag and R. Busam, Funktionentheorie 1, 4. Auflage, Springer, 2006, p. 392.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 314, Theorem 386.
  • Carlos J. Moreno and Samuel S. Wagstaff, Jr., Sums of Squares of integers, Chapman & Hall/CRC, 2006, p. 29.
  • S. Ramanujan, Collected Papers, Chap. 20, Cambridge Univ. Press 1927 (Proceedings of the Camb. Phil. Soc., 19 (1917) 11-21).

Crossrefs

Row d=4 of A122141 and of A319574, 4th column of A286815.
For number of solutions to a^2+b^2+c^2+k*d^2=n for k=1, 2, 3, 4, 5, 6, 7, 8, 12, see A000118, A236928, A236926, A236923, A236930, A236931, A236932, A236927, A236933.

Programs

  • Haskell
    a000118 0 = 1
    a000118 n = 8 * a046897 n  -- Reinhard Zumkeller, Aug 12 2015
    
  • Julia
    # JacobiTheta3 is defined in A000122.
    A000118List(len) = JacobiTheta3(len, 4)
    A000118List(57) |> println # Peter Luschny, Mar 12 2018
    
  • MATLAB
    a(n) = 8 * sum(find(mod(n,1:n)==0 & mod(1:n,4))) + (n==0) % David Mellinger, Aug 04 2025
  • Magma
    A := Basis( ModularForms( Gamma0(4), 2), 57); A[1] + 8*A[2]; /* Michael Somos, Aug 21 2014 */
    
  • Maple
    (add(q^(m^2),m=-10..10))^4; seq(coeff(%,q,n), n=0..50);
    # Alternative:
    A000118list := proc(len) series(JacobiTheta3(0, x)^4, x, len+1);
    seq(coeff(%, x, j), j=0..len-1) end: A000118list(57); # Peter Luschny, Oct 02 2018
  • Mathematica
    Table[SquaresR[4, n], {n, 0, 46}]
    a[ n_] :=  SeriesCoefficient[ EllipticTheta[ 3, 0, q]^4, {q, 0, n}]; (* Michael Somos, Jun 12 2014 *)
    a[ n_] := If[ n < 1, Boole[ n == 0], 8 Sum[ If[ Mod[ d, 4] > 0, d, 0], {d, Divisors @ n }]]; (* Michael Somos, Feb 20 2015 *)
    QP = QPochhammer; CoefficientList[QP[-q]^8/QP[q^2]^4 + O[q]^60, q] (* Jean-François Alcover, Nov 24 2015 *)
  • PARI
    {a(n) = if( n<1, n==0, 8 * sumdiv( n, d, if( d%4, d)))}; /* Michael Somos, Apr 01 2003 */
    
  • PARI
    {a(n) = local(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A)^5 / (eta(x + A)^2 * eta(x^4 + A)^2))^4, n))}; /* Michael Somos, Apr 01 2008 */
    
  • PARI
    q='q+O('q^66); Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^4) /* Joerg Arndt, Apr 08 2013 */
    
  • PARI
    a(n) = 8*sigma(n) - if (n % 4, 0, 32*sigma(n/4)); \\ Michel Marcus, Jul 13 2016
    
  • Python
    from sympy import divisors
    def a(n): return 1 if n==0 else 8*sum(d for d in divisors(n) if d%4 != 0)
    print([a(n) for n in range(57)]) # Michael S. Branicky, Jan 08 2021
    
  • Python
    from sympy import divisor_sigma
    def A000118(n): return 1 if n == 0 else 8*divisor_sigma(n) if n % 2 else 24*divisor_sigma(int(bin(n)[2:].rstrip('0'),2)) # Chai Wah Wu, Jun 27 2022
    
  • Sage
    A = ModularForms( Gamma0(4), 2, prec=57) . basis(); A[0] + 8*A[1]; # Michael Somos, Jun 12 2014
    
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1]*4)
    Q.representation_number_list(60) # Peter Luschny, Jun 20 2014
    

Formula

G.f.: theta_3(q)^4 = (Product_{n>=1} (1-q^(2n))*(1+q^(2n-1))^2)^4 = eta(-q)^8/eta(q^2)^4; eta = Dedekind's function.
a(n) = 8*sigma(n) - 32*sigma(n/4) for n > 0, where the latter term is 0 if n is not a multiple of 4.
Euler transform of period 4 sequence [8, -12, 8, -4, ...]. - Michael Somos, Dec 16 2002
G.f. A(x) satisfies 0 = f(A(x), A(x^3), A(x^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). - Michael Somos, Nov 02 2006
G.f. is a period 1 Fourier series which satisfies f(-1/(4*t)) = 4*(t/i)^2*f(t) where q = exp(2*Pi*i*t). - Michael Somos, Jan 25 2008
For n > 0, a(n)/8 is multiplicative and a(p^n)/8 = 1 + p + p^2 + ... + p^n for p an odd prime, a(2^n)/8 = 1 + 2 for n > 0.
a(n) = 8*A000203(n/A006519(n))*(2 + (-1)^n). - Benoit Cloitre, May 16 2002
G.f.: 1 + 8*Sum_{k>0} x^k / (1 + (-x)^k)^2 = 1 + 8*Sum_{k>0} k * x^k / (1 + (-x)^k).
G.f. = s(2)^20/(s(1)*s(4))^8, where s(k) := subs(q=q^k, eta(q)), where eta(q) is Dedekind's function, cf. A010815. [Fine]
Fine gives another explicit formula for a(n) in terms of the divisors of n.
a(n) = 8*A046897(n), n > 0. - Ralf Stephan, Apr 02 2003
A096727(n) = (-1)^n * a(n). a(2*n) = A004011(n). a(2*n + 1) = A005879(n).
Dirichlet g.f.: Sum_{n>=1} a(n)/n^s = 8*(1-4^(1-s))*zeta(s)*zeta(s-1). [Ramanu. J. 7 (2003) 95-127, eq (3.2)]. - R. J. Mathar, Jul 02 2012
Average value is (Pi^2/2)*n + O(sqrt(n)). - Charles R Greathouse IV, Feb 17 2015
From Wolfdieter Lang, Jan 14 2016: (Start)
For n >= 1: a(n) = 8*Sum_{d | n} b(d)*d, with b(d) = 1 if d/4 is not an integer else 0. See, e.g., the Freitag-Busam reference, p. 392.
For n >= 1: a(n) = 8*sigma(n) if n is odd else 24*sigma(m(n)), where m(n) is the largest odd divisor of n (see A000265), and sigma is given in A000203. See the Moreno-Wagstaff reference, Theorem 2. 6 (Jacobi), p. 29. (End)
a(n) = (8/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017

A040000 a(0)=1; a(n)=2 for n >= 1.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

Continued fraction expansion of sqrt(2) is 1 + 1/(2 + 1/(2 + 1/(2 + ...))).
Inverse binomial transform of Mersenne numbers A000225(n+1) = 2^(n+1) - 1. - Paul Barry, Feb 28 2003
A Chebyshev transform of 2^n: if A(x) is the g.f. of a sequence, map it to ((1-x^2)/(1+x^2))A(x/(1+x^2)). - Paul Barry, Oct 31 2004
An inverse Catalan transform of A068875 under the mapping g(x)->g(x(1-x)). A068875 can be retrieved using the mapping g(x)->g(xc(x)), where c(x) is the g.f. of A000108. A040000 and A068875 may be described as a Catalan pair. - Paul Barry, Nov 14 2004
Sequence of electron arrangement in the 1s 2s and 3s atomic subshells. Cf. A001105, A016825. - Jeremy Gardiner, Dec 19 2004
Binomial transform of A165326. - Philippe Deléham, Sep 16 2009
Let m=2. We observe that a(n) = Sum_{k=0..floor(n/2)} binomial(m,n-2*k). Then there is a link with A113311 and A115291: it is the same formula with respectively m=3 and m=4. We can generalize this result with the sequence whose g.f. is given by (1+z)^(m-1)/(1-z). - Richard Choulet, Dec 08 2009
With offset 1: number of permutations where |p(i) - p(i+1)| <= 1 for n=1,2,...,n-1. This is the identical permutation and (for n>1) its reversal.
Equals INVERT transform of bar(1, 1, -1, -1, ...).
Eventual period is (2). - Zak Seidov, Mar 05 2011
Also decimal expansion of 11/90. - Vincenzo Librandi, Sep 24 2011
a(n) = 3 - A054977(n); right edge of the triangle in A182579. - Reinhard Zumkeller, May 07 2012
With offset 1: minimum cardinality of the range of a periodic sequence with (least) period n. Of course the range's maximum cardinality for a purely periodic sequence with (least) period n is n. - Rick L. Shepherd, Dec 08 2014
With offset 1: n*a(1) + (n-1)*a(2) + ... + 2*a(n-1) + a(n) = n^2. - Warren Breslow, Dec 12 2014
With offset 1: decimal expansion of gamma(4) = 11/9 where gamma(n) = Cp(n)/Cv(n) is the n-th Poisson's constant. For the definition of Cp and Cv see A272002. - Natan Arie Consigli, Sep 11 2016
a(n) equals the number of binary sequences of length n where no two consecutive terms differ. Also equals the number of binary sequences of length n where no two consecutive terms are the same. - David Nacin, May 31 2017
a(n) is the period of the continued fractions for sqrt((n+2)/(n+1)) and sqrt((n+1)/(n+2)). - A.H.M. Smeets, Dec 05 2017
Also, number of self-avoiding walks and coordination sequence for the one-dimensional lattice Z. - Sean A. Irvine, Jul 27 2020

Examples

			sqrt(2) = 1.41421356237309504... = 1 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + ...)))). - _Harry J. Smith_, Apr 21 2009
G.f. = 1 + 2*x + 2*x^2 + 2*x^3 + 2*x^4 + 2*x^5 + 2*x^6 + 2*x^7 + 2*x^8 + ...
11/90 = 0.1222222222222222222... - _Natan Arie Consigli_, Sep 11 2016
		

References

  • A. Beiser, Concepts of Modern Physics, 2nd Ed., McGraw-Hill, 1973.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 186.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §4.4 Powers and Roots, p. 144.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 276-278.

Crossrefs

Convolution square is A008574.
See A003945 etc. for (1+x)/(1-k*x).
From Jaume Oliver Lafont, Mar 26 2009: (Start)
Sum_{0<=k<=n} a(k) = A005408(n).
Prod_{0<=k<=n} a(k) = A000079(n). (End)
Cf. A000674 (boustrophedon transform).
Cf. A001333/A000129 (continued fraction convergents).
Cf. A000122, A002193 (sqrt(2) decimal expansion), A006487 (Egyptian fraction).
Cf. Other continued fractions for sqrt(a^2+1) = (a, 2a, 2a, 2a....): A040002 (contfrac(sqrt(5)) = (2,4,4,...)), A040006, A040012, A040020, A040030, A040042, A040056, A040072, A040090, A040110 (contfrac(sqrt(122)) = (11,22,22,...)), A040132, A040156, A040182, A040210, A040240, A040272, A040306, A040342, A040380, A040420 (contfrac(sqrt(442)) = (21,42,42,...)), A040462, A040506, A040552, A040600, A040650, A040702, A040756, A040812, A040870, A040930 (contfrac(sqrt(962)) = (31,62,62,...)).

Programs

  • Haskell
    a040000 0 = 1; a040000 n = 2
    a040000_list = 1 : repeat 2  -- Reinhard Zumkeller, May 07 2012
  • Maple
    Digits := 100: convert(evalf(sqrt(2)),confrac,90,'cvgts'):
  • Mathematica
    ContinuedFraction[Sqrt[2],300] (* Vladimir Joseph Stephan Orlovsky, Mar 04 2011 *)
    a[ n_] := 2 - Boole[n == 0]; (* Michael Somos, Dec 28 2014 *)
    PadRight[{1},120,2] (* or *) RealDigits[11/90, 10, 120][[1]] (* Harvey P. Dale, Jul 12 2025 *)
  • PARI
    {a(n) = 2-!n}; /* Michael Somos, Apr 16 2007 */
    
  • PARI
    a(n)=1+sign(n)  \\ Jaume Oliver Lafont, Mar 26 2009
    
  • PARI
    allocatemem(932245000); default(realprecision, 21000); x=contfrac(sqrt(2)); for (n=0, 20000, write("b040000.txt", n, " ", x[n+1]));  \\ Harry J. Smith, Apr 21 2009
    

Formula

G.f.: (1+x)/(1-x). - Paul Barry, Feb 28 2003
a(n) = 2 - 0^n; a(n) = Sum_{k=0..n} binomial(1, k). - Paul Barry, Oct 16 2004
a(n) = n*Sum_{k=0..floor(n/2)} (-1)^k*binomial(n-k, k)*2^(n-2*k)/(n-k). - Paul Barry, Oct 31 2004
A040000(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*(-1)^k*A068875(n-k). - Paul Barry, Nov 14 2004
From Michael Somos, Apr 16 2007: (Start)
Euler transform of length 2 sequence [2, -1].
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = (u-v)*(u+v) - 2*v*(u-w).
E.g.f.: 2*exp(x) - 1.
a(n) = a(-n) for all n in Z (one possible extension to n<0). (End)
G.f.: (1-x^2)/(1-x)^2. - Jaume Oliver Lafont, Mar 26 2009
G.f.: exp(2*atanh(x)). - Jaume Oliver Lafont, Oct 20 2009
a(n) = Sum_{k=0..n} A108561(n,k)*(-1)^k. - Philippe Deléham, Nov 17 2013
a(n) = 1 + sign(n). - Wesley Ivan Hurt, Apr 16 2014
10 * 11/90 = 11/9 = (11/2 R)/(9/2 R) = Cp(4)/Cv(4) = A272005/A272004, with R = A081822 (or A070064). - Natan Arie Consigli, Sep 11 2016
a(n) = A001227(A000040(n+1)). - Omar E. Pol, Feb 28 2018
Showing 1-10 of 1511 results. Next