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 66 results. Next

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

A002654 Number of ways of writing n as a sum of at most two nonzero squares, where order matters; also (number of divisors of n of form 4m+1) - (number of divisors of form 4m+3).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Glaisher calls this E(n) or E_0(n). - N. J. A. Sloane, Nov 24 2018
Number of sublattices of Z X Z of index n that are similar to Z X Z; number of (principal) ideals of Z[i] of norm n.
a(n) is also one fourth of the number of integer solutions of n = x^2 + y^2 (order and signs matter, and 0 (without signs) is allowed). a(n) = N(n)/4, with N(n) from p. 147 of the Niven-Zuckermann reference. See also Theorem 5.12, p. 150, which defines a (strongly) multiplicative function h(n) which coincides with A056594(n-1), n >= 1, and N(n)/4 = sum(h(d), d divides n). - Wolfdieter Lang, Apr 19 2013
a(2+8*N) = A008441(N) gives the number of ways of writing N as the sum of 2 (nonnegative) triangular numbers for N >= 0. - Wolfdieter Lang, Jan 12 2017
Coefficients of Dedekind zeta function for the quadratic number field of discriminant -4. See A002324 for formula and Maple code. - N. J. A. Sloane, Mar 22 2022

Examples

			4 = 2^2, so a(4) = 1; 5 = 1^2 + 2^2 = 2^2 + 1^2, so a(5) = 2.
x + x^2 + x^4 + 2*x^5 + x^8 + x^9 + 2*x^10 + 2*x^13 + x^16 + 2*x^17 + x^18 + ...
2 = (+1)^2 + (+1)^2 = (+1)^2 + (-1)^2  = (-1)^2 + (+1)^2 = (-1)^2 + (-1)^2. Hence there are 4 integer solutions, called N(2) in the Niven-Zuckerman reference, and a(2) = N(2)/4 = 1.  4 = 0^1 + (+2)^2 = (+2)^2 + 0^2 = 0^2 + (-2)^2 = (-2)^2 + 0^2. Hence N(4) = 4 and a(4) = N(4)/4 = 1. N(5) = 8, a(5) = 2. - _Wolfdieter Lang_, Apr 19 2013
		

References

  • J. M. Borwein, D. H. Bailey and R. Girgensohn, Experimentation in Mathematics, A K Peters, Ltd., Natick, MA, 2004. x+357 pp. See p. 194.
  • George Chrystal, Algebra: An elementary text-book for the higher classes of secondary schools and for colleges, 6th ed., Chelsea Publishing Co., New York, 1959, Part II, p. 346 Exercise XXI(17). MR0121327 (22 #12066)
  • Emil Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 15.
  • Ivan Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers, New York: John Wiley, 1980, pp. 147 and 150.
  • Günter Scheja and Uwe Storch, Lehrbuch der Algebra, Tuebner, 1988, p. 251.
  • 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, page 89.
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 340.

Crossrefs

Equals 1/4 of A004018. Partial sums give A014200.
Cf. A002175, A008441, A121444, A122856, A122865, A022544, A143574, A000265, A027748, A124010, A025426 (two squares, order does not matter), A120630 (Dirichlet inverse), A101455 (Mobius transform), A000089, A241011.
If one simply reads the table in Glaisher, PLMS 1884, which omits the zero entries, one gets A213408.
Dedekind zeta functions for imaginary quadratic number fields of discriminants -3, -4, -7, -8, -11, -15, -19, -20 are A002324, A002654, A035182, A002325, A035179, A035175, A035171, A035170, respectively.
Dedekind zeta functions for real quadratic number fields of discriminants 5, 8, 12, 13, 17, 21, 24, 28, 29, 33, 37, 40 are A035187, A035185, A035194, A035195, A035199, A035203, A035188, A035210, A035211, A035215, A035219, A035192, respectively.

Programs

  • Haskell
    a002654 n = product $ zipWith f (a027748_row m) (a124010_row m) where
       f p e | p `mod` 4 == 1 = e + 1
             | otherwise      = (e + 1) `mod` 2
       m = a000265 n
    -- Reinhard Zumkeller, Mar 18 2013
    
  • Maple
    with(numtheory):
    A002654 := proc(n)
        local count1, count3, d;
        count1 := 0:
        count3 := 0:
        for d in numtheory[divisors](n) do
            if d mod 4 = 1 then
                count1 := count1+1
            elif d mod 4 = 3 then
                count3 := count3+1
            fi:
        end do:
        count1-count3;
    end proc:
    # second Maple program:
    a:= n-> add(`if`(d::odd, (-1)^((d-1)/2), 0), d=numtheory[divisors](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 04 2020
  • Mathematica
    a[n_] := Count[Divisors[n], d_ /; Mod[d, 4] == 1] - Count[Divisors[n], d_ /; Mod[d, 4] == 3]; a/@Range[105] (* Jean-François Alcover, Apr 06 2011, after R. J. Mathar *)
    QP = QPochhammer; CoefficientList[(1/q)*(QP[q^2]^10/(QP[q]*QP[q^4])^4-1)/4 + O[q]^100, q] (* Jean-François Alcover, Nov 24 2015 *)
    f[2, e_] := 1; f[p_, e_] := If[Mod[p, 4] == 1, e + 1, Mod[e + 1, 2]]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 19 2020 *)
    Rest[CoefficientList[Series[EllipticTheta[3, 0, q]^2/4, {q, 0, 100}], q]] (* Vaclav Kotesovec, Mar 10 2023 *)
  • PARI
    direuler(p=2,101,1/(1-X)/(1-kronecker(-4,p)*X))
    
  • PARI
    {a(n) = polcoeff( sum(k=1, n, x^k / (1 + x^(2*k)), x * O(x^n)), n)}
    
  • PARI
    {a(n) = sumdiv( n, d, (d%4==1) - (d%4==3))}
    
  • PARI
    {a(n) = local(A); A = x * O(x^n); polcoeff( eta(x^2 + A)^10 / (eta(x + A) * eta(x^4 + A))^4 / 4, n)} \\ Michael Somos, Jun 03 2005
    
  • PARI
    a(n)=my(f=factor(n>>valuation(n,2))); prod(i=1,#f~, if(f[i,1]%4==1, f[i,2]+1, (f[i,2]+1)%2)) \\ Charles R Greathouse IV, Sep 09 2014
    
  • PARI
    my(B=bnfinit(x^2+1)); vector(100,n,#bnfisintnorm(B,n)) \\ Joerg Arndt, Jun 01 2024
    
  • Python
    from math import prod
    from sympy import factorint
    def A002654(n): return prod(1 if p == 2 else (e+1 if p % 4 == 1 else (e+1) % 2) for p, e in factorint(n).items()) # Chai Wah Wu, May 09 2022

Formula

Dirichlet series: (1-2^(-s))^(-1)*Product (1-p^(-s))^(-2) (p=1 mod 4) * Product (1-p^(-2s))^(-1) (p=3 mod 4) = Dedekind zeta-function of Z[ i ].
Coefficients in expansion of Dirichlet series Product_p (1-(Kronecker(m, p)+1)*p^(-s)+Kronecker(m, p)*p^(-2s))^(-1) for m = -16.
If n=2^k*u*v, where u is product of primes 4m+1, v is product of primes 4m+3, then a(n)=0 unless v is a square, in which case a(n) = number of divisors of u (Jacobi).
Multiplicative with a(p^e) = 1 if p = 2; e+1 if p == 1 (mod 4); (e+1) mod 2 if p == 3 (mod 4). - David W. Wilson, Sep 01 2001
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 + 1). - Michael Somos, Jul 19 2004
G.f.: Sum_{n>=1} ((-1)^floor(n/2)*x^((n^2+n)/2)/(1+(-x)^n)). - Vladeta Jovovic, Sep 15 2004
Expansion of (eta(q^2)^10 / (eta(q) * eta(q^4))^4 - 1)/4 in powers of q.
G.f.: Sum_{k>0} x^k / (1 + x^(2*k)) = Sum_{k>0} -(-1)^k * x^(2*k - 1) / (1 - x^(2*k - 1)). - Michael Somos, Aug 17 2005
a(4*n + 3) = a(9*n + 3) = a(9*n + 6) = 0. a(9*n) = a(2*n) = a(n). - Michael Somos, Nov 01 2006
a(4*n + 1) = A008441(n). a(3*n + 1) = A122865(n). a(3*n + 2) = A122856(n). a(12*n + 1) = A002175(n). a(12*n + 5) = 2 * A121444(n). 4 * a(n) = A004018(n) unless n=0.
a(n) = Sum_{k=1..n} A010052(k)*A010052(n-k). a(A022544(n)) = 0; a(A001481(n)) > 0.
- Reinhard Zumkeller, Sep 27 2008
a(n) = A001826(n) - A001842(n). - R. J. Mathar, Mar 23 2011
a(n) = Sum_{d|n} A056594(d-1), n >= 1. See the above comment on A056594(d-1) = h(d) of the Niven-Zuckerman reference. - Wolfdieter Lang, Apr 19 2013
Dirichlet g.f.: zeta(s)*beta(s) = zeta(s)*L(chi_2(4),s). - Ralf Stephan, Mar 27 2015
G.f.: (theta_3(x)^2 - 1)/4, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 17 2018
a(n) = Sum_{ m: m^2|n } A000089(n/m^2). - Andrey Zabolotskiy, May 07 2018
a(n) = A053866(n) + 2 * A025441(n). - Andrey Zabolotskiy, Apr 23 2019
a(n) = Im(Sum_{d|n} i^d). - Ridouane Oudra, Feb 02 2020
a(n) = Sum_{d|n} sin((1/2)*d*Pi). - Ridouane Oudra, Jan 22 2021
Sum_{n>=1} (-1)^n*a(n)/n = Pi*log(2)/4 (Covo, 2010). - Amiram Eldar, Apr 07 2022
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/4 = 0.785398... (A003881). - Amiram Eldar, Oct 11 2022
From Vaclav Kotesovec, Mar 10 2023: (Start)
Sum_{k=1..n} a(k)^2 ~ n * (log(n) + C) / 4, where C = A241011 =
4*gamma - 1 + log(2)/3 - 2*log(Pi) + 8*log(Gamma(3/4)) - 12*Zeta'(2)/Pi^2 = 2.01662154573340811526279685971511542645018417752364748061...
The constant C, published by Ramanujan (1916, formula (22)), 4*gamma - 1 + log(2)/3 - log(Pi) + 4*log(Gamma(3/4)) - 12*Zeta'(2)/Pi^2 = 2.3482276258576... is wrong! (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

A008443 Number of ordered ways of writing n as the sum of 3 triangular numbers.

Original entry on oeis.org

1, 3, 3, 4, 6, 3, 6, 9, 3, 7, 9, 6, 9, 9, 6, 6, 15, 9, 7, 12, 3, 15, 15, 6, 12, 12, 9, 12, 15, 6, 13, 21, 12, 6, 15, 9, 12, 24, 9, 18, 12, 9, 18, 15, 12, 13, 24, 9, 15, 24, 6, 18, 27, 6, 12, 15, 18, 24, 21, 15, 12, 27, 9, 13, 18, 15, 27, 27, 9, 12, 27, 15, 24, 21, 12, 15, 30, 15, 12
Offset: 0

Views

Author

Keywords

Comments

Fermat asserted that every number is the sum of three triangular numbers. This was proved by Gauss, who recorded in his Tagebuch entry for Jul 10 1796 that: EYPHEKA! num = DELTA + DELTA + DELTA. See also Gauss, DA, art. 293.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Andrews (2016), Theorem 2, shows that A008443(n) = A290735(n) + A290737(n) + A290739(n). = N. J. A. Sloane, Aug 10 2017

Examples

			5 can be written as 3+1+1, 1+3+1, 1+1+3, so a(5) = 3.
G.f. = 1 + 3*x + 3*x^2 + 4*x^3 + 6*x^4 + 3*x^5 + 6*x^6 + 9*x^7 + 3*x^8 + ...
G.f. = q^3 + 3*q^11 + 3*q^19 + 4*q^27 + 6*q^35 + 3*q^43 + 6*q^51 + 9*q^59 + 3*q^67 + ...
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
  • C. F. Gauss, Disquisitiones Arithmeticae, Yale University Press, 1966, New Haven and London, p. 342, art. 293.
  • M. Nathanson, Additive Number Theory: The Classical Bases, Graduate Texts in Mathematics, Volume 165, Springer-Verlag, 1996. See Chapter 1.

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.
Partial sums are in A038835.

Programs

  • Magma
    Basis( ModularForms( Gamma0(16), 3/2), 630)[4]; /* Michael Somos, Aug 26 2015 */
  • Maple
    s1 := sum(q^(n*(n+1)/2), n=0..30): s2 := series(s1^3, q, 250): for i from 0 to 200 do printf(`%d,`,coeff(s2, q, i)) od:
  • Mathematica
    s1 = Sum[q^(n (n + 1)/2), {n, 0, 12}]; s2 = Series[s1^3, {q, 0, 80}]; CoefficientList[s2, q] (* Jean-François Alcover, Oct 04 2011, after Maple *)
    a[ n_] := SeriesCoefficient[ (1/8) EllipticTheta[ 2, 0, q]^3, {q, 0, 2 n + 3/4}]; (* Michael Somos, May 29 2012 *)
    QP = QPochhammer; CoefficientList[(QP[q^2]^2/QP[q])^3 + O[q]^80, q] (* Jean-François Alcover, Nov 24 2015 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum(k=0, (sqrtint(8*n + 1) - 1)\2, x^((k^2 + k)/2), x * O(x^n))^3, n))}; /* Michael Somos, Oct 25 2006 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A)^2 / eta(x + A))^3, n))}; /* Michael Somos, Oct 25 2006 */
    

Formula

Expansion of Jacobi theta constant theta_2^3 /8. G.f. is cube of g.f. for A010054.
Expansion of psi(q)^3 in powers of q where psi() is a Ramanujan theta function (A010054). - Michael Somos, Oct 25 2006
Expansion of q^(-3/8) * (eta(q^2)^2 / eta(q))^3 in powers of q. - Michael Somos, May 29 2012
Euler transform of period 2 sequence [ 3, -3, ...]. - Michael Somos, Oct 25 2006
G.f. is a period 1 Fourier series which satisfies f(-1 / (16 t)) = 2^(-3/2) (t/i)^(3/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A213384. - Michael Somos, Jun 23 2012
a(3*n) = A213627(n). a(3*n + 1) = 3 * A213617(n). a(3*n + 2) = A181648(n). - Michael Somos, Jun 23 2012
G.f.: (Sum_{k>0} x^((k^2 - k)/2))^3 = (Product_{k>0} (1 + x^k) * (1 - x^(2*k)))^3. - Michael Somos, May 29 2012
a(n) = A005869(n)/2 = A005886(n)/4 = A005878(n)/8.
a(n) = A005875(8*n+3)/8. See, e.g., the Ono et al. link: The case k=3. - Wolfdieter Lang, Jan 12 2017
a(0) = 1, a(n) = (3/n)*Sum_{k=1..n} A002129(k)*a(n-k) for n > 0. - Seiichi Manyama, May 06 2017

Extensions

More terms from James Sellers, Feb 07 2001

A007331 Fourier coefficients of E_{infinity,4}.

Original entry on oeis.org

0, 1, 8, 28, 64, 126, 224, 344, 512, 757, 1008, 1332, 1792, 2198, 2752, 3528, 4096, 4914, 6056, 6860, 8064, 9632, 10656, 12168, 14336, 15751, 17584, 20440, 22016, 24390, 28224, 29792, 32768, 37296, 39312, 43344, 48448, 50654, 54880, 61544, 64512
Offset: 0

Views

Author

Keywords

Comments

E_{infinity,4} is the unique normalized weight-4 modular form for Gamma_0(2) with simple zeros at i*infinity. Since this has level 2, it is not a cusp form, in contrast to A002408.
a(n+1) is the number of representations of n as a sum of 8 triangular numbers (from A000217). See the Ono et al. link, Theorem 5.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
a(n) gives the sum of cubes of divisors d of n such that n/d is odd. This is called sigma^#3(n) in the Ono et al. link. See a formula below. - _Wolfdieter Lang, Jan 12 2017

Examples

			G.f. = q + 8*q^2 + 28*q^3 + 64*q^4 + 126*q^5 + 224*q^6 + 344*q^7 + 512*q^8 + ...
		

References

  • B. C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag, see p. 139, Ex (ii).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

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, A076577.

Programs

  • Magma
    Basis( ModularForms( Gamma0(2), 4), 10) [2]; /* Michael Somos, May 27 2014 */
    
  • Maple
    nmax:=40: seq(coeff(series(x*(product((1-x^k)^8*(1+x^k)^16, k=1..nmax)), x, n+1), x, n), n=0..nmax); # Vaclav Kotesovec, Oct 14 2015
  • Mathematica
    Prepend[Table[Plus @@ (Select[Divisors[k + 1], OddQ[(k + 1)/#] &]^3), {k, 0, 39}], 0] (* Ant King, Dec 04 2010 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, 0, q^(1/2)]^8 / 256, {q, 0, n}]; (* Michael Somos, Jun 04 2013 *)
    a[ n_] := If[ n < 1, 0, Sum[ d^3 Boole[ OddQ[ n/d]], {d, Divisors[ n]}]]; (* Michael Somos, Jun 04 2013 *)
    f[n_] := Total[(2n/Select[ Divisors[ 2n], Mod[#, 4] == 2 &])^3]; Flatten[{0, Array[f, 40] }] (* Robert G. Wilson v, Mar 26 2015 *)
    nmax=60; CoefficientList[Series[x*Product[(1-x^k)^8 * (1+x^k)^16, {k,1,nmax}],{x,0,nmax}], x] (* Vaclav Kotesovec, Oct 14 2015 *)
    QP = QPochhammer; s = q * (QP[-1, q]/2)^16 * QP[q]^8 + O[q]^50; CoefficientList[s, q] (* Jean-François Alcover, Dec 01 2015, adapted from PARI *)
  • PARI
    {a(n) = if( n<1, 0, sumdiv( n, d, (n/d%2) * d^3))}; /* Michael Somos, May 31 2005 */
    
  • PARI
    {a(n) = local(A); if( n<1, 0, n--; A = x * O(x^n); polcoeff( (eta(x^2 + A)^2 / eta(x + A))^8, n))}; /* Michael Somos, May 31 2005 */
    
  • PARI
    a(n)=my(e=valuation(n,2)); 8^e * sigma(n/2^e, 3) \\ Charles R Greathouse IV, Sep 09 2014
    
  • Python
    from sympy import divisors
    def a(n):
        return 0 if n == 0 else sum(((n//d)%2)*d**3 for d in divisors(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 24 2017
  • Sage
    ModularForms( Gamma0(2), 4, prec=33).1; # Michael Somos, Jun 04 2013
    

Formula

G.f.: q * Product_{k>=1} (1-q^k)^8 * (1+q^k)^16. - corrected by Vaclav Kotesovec, Oct 14 2015
a(n) = Sum_{0
G.f.: Sum_{n>0} n^3*x^n/(1-x^(2*n)). - Vladeta Jovovic, Oct 24 2002
Expansion of Jacobi theta constant theta_2(q)^8 / 256 in powers of q.
Expansion of eta(q^2)^16 / eta(q)^8 in powers of q. - Michael Somos, May 31 2005
Expansion of x * psi(x)^8 in powers of x where psi() is a Ramanujan theta function. - Michael Somos, Jan 15 2012
Expansion of (Q(x) - Q(x^2)) / 240 in powers of x where Q() is a Ramanujan Lambert series. - Michael Somos, Jan 15 2012
Expansion of E_{gamma,2}^2 * E_{0,4} in powers of q.
Euler transform of period 2 sequence [8, -8, ...]. - Michael Somos, May 31 2005
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = v^3 - u^2*w + 16*u*v*w - 32*v^2*w + 256*v*w^2. - Michael Somos, May 31 2005
G.f. is a period 1 Fourier series which satisfies f(-1 / (2 t)) = 16^(-1) (t / i)^4 g(t) where q = exp(2 Pi i t) and g() is the g.f. for A035016. - Michael Somos, Jan 11 2009
Multiplicative with a(2^e) = 2^(3e), a(p^e) = (p^(3(e+1))-1)/(p^3-1). - Mitch Harris, Jun 13 2005
Dirichlet convolution of A154955 by A001158. Dirichlet g.f. zeta(s)*zeta(s-3)*(1-1/2^s). - R. J. Mathar, Mar 31 2011
A002408(n) = -(-1)^n * a(n).
Convolution square of A008438. - Michael Somos, Jun 15 2014
a(1) = 1, a(n) = (8/(n-1))*Sum_{k=1..n-1} A002129(k)*a(n-k) for n > 0. - Seiichi Manyama, May 06 2017
Sum_{k=1..n} a(k) ~ c * n^4, where c = Pi^4/384 = 0.253669... (A222072). - Amiram Eldar, Oct 19 2022

Extensions

Additional comments from Barry Brent (barryb(AT)primenet.com)
Wrong Maple program replaced by Vaclav Kotesovec, Oct 14 2015
a(0)=0 prepended by Vaclav Kotesovec, Oct 14 2015

A097195 Expansion of s(12)^3*s(18)^2/(s(6)^2*s(36)), where s(k) = eta(q^k) and eta(q) is Dedekind's function, cf. A010815. Then replace q^6 with q.

Original entry on oeis.org

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

Author

N. J. A. Sloane, Sep 16 2004

Keywords

Examples

			G.f. = 1 + 2*x + 2*x^2 + 2*x^3 + x^4 + 2*x^5 + 2*x^6 + 2*x^7 + 3*x^8 + ...
G.f. = q + 2*q^7 + 2*q^13 + 2*q^19 + q^25 + 2*q^31 + 2*q^37 + 2*q^43 + ...
		

References

  • Nathan J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 80, Eq. (32.38).

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSum[6n+1, KroneckerSymbol[-3, #]&]; Table[a[n], {n, 0, 100} ] (* Jean-François Alcover, Nov 23 2015, after Michael Somos *)
    QP = QPochhammer; s = QP[q^2]^3*(QP[q^3]^2/QP[q]^2/QP[q^6]) + O[q]^105; CoefficientList[s, q] (* Jean-François Alcover, Nov 27 2015 *)
    a[ n_] := If[ n < 1, Boole[n == 0], Times @@ (Which[# < 2, 0^#2, Mod[#, 6] == 5, 1 - Mod[#2, 2], True, #2 + 1] & @@@ FactorInteger@(6 n + 1))]; (* Michael Somos, Mar 05 2016 *)
  • PARI
    {a(n) = if( n<0, 0, sumdiv(6*n+1, d, kronecker(-3, d)))}; /* Michael Somos, Nov 03 2005 */
    
  • 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>3, if( p%6==1, e+1, !(e%2)))))}; /* Michael Somos, Nov 03 2005 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^3 * eta(x^3 + A)^2 / (eta(x + A)^2 * eta(x^6 + A)), n))}; /* Michael Somos, Nov 03 2005 */

Formula

Fine gives an explicit formula for a(n) in terms of the divisors of n.
a(n) = b(6*n + 1) where b() is multiplicative with b(2^e) = b(3^e) = 0^e, b(p^e) = e+1 if p == 1 (mod 6), b(p^e) = (1 + (-1)^e)/2 if p == 5 (mod 6).
From Michael Somos, Nov 03 2005: (Start)
G.f.: Sum_{k in Z} x^k / (1 - x^(6*k + 1)).
G.f.: Sum_{k>=0} a(k) * x^(6*k + 1) = Sum_{k>0} x^(2*k-1) * (1 - x^(4*k - 2)) * (1 - x^(8*k - 4)) * (1 - x^(20*k - 10)) / (1 - x^(36*k - 18)). (End)
From Michael Somos, Mar 05 2016: (Start)
Expansion of q^(-1/6) * eta(q^2)^3 * eta(q^3)^2 / (eta(q)^2 * eta(q^6)) in powers of q.
Euler transform of period 6 sequence [ 2, -1, 0, -1, 2, -2, ...].
6 * a(n) = A004016(6*n + 1). (End)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/sqrt(3) = 1.813799... (A093602). - Amiram Eldar, Nov 24 2023

A002175 Excess of number of divisors of 12n+1 of form 4k+1 over those of form 4k+3.

Original entry on oeis.org

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

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Number of ways to write n as an ordered sum of 2 generalized pentagonal numbers. - Ilya Gutkovskiy, Aug 14 2017

Examples

			G.f. = 1 + 2*x + 3*x^2 + 2*x^3 + x^4 + 2*x^5 + 2*x^6 + 4*x^7 + 2*x^8 + 2*x^9 + ...
G.f. = q + 2*q^13 + 3*q^25 + 2*q^37 + q^49 + 2*q^61 + 2*q^73 + 4*q^85 + 2*q^97 + ...
		

References

  • 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).

Programs

  • Maple
    series(mul( ( (1 + q^n)*(1 - q^(3*n))/(1 + q^(3*n)) )^2, n = 1..100), q, 101):
    seq(coeftayl(%, q = 0, n), n = 0..100); # Peter Bala, Jan 05 2025
  • Mathematica
    ed[n_]:=Module[{divs=Divisors[12n+1]},Count[divs,?(Mod[#,4] == 1&)]- Count[divs,?(Mod[#,4]==3&)]]; Array[ed,110,0] (* Harvey P. Dale, Jul 01 2012 *)
    a[ n_] := If[ n < 0, 0, With[ {m = 12 n + 1}, Sum[ KroneckerSymbol[ 4, d], {d, Divisors[m]}]]]; (* Michael Somos, Apr 23 2014 *)
    a[ n_] := SeriesCoefficient[ (QPochhammer[ x^2] QPochhammer[ x^3]^2 / (QPochhammer[ x] QPochhammer[ x^6]))^2, {x, 0, n}]; (* Michael Somos, Apr 23 2014 *)
    a[ n_] := SeriesCoefficient[ (EllipticTheta[ 4, 0, x^3] / QPochhammer[ x, x^2])^2, {x, 0, n}]; (* Michael Somos, May 25 2015 *)
  • PARI
    {a(n) = if( n<0, 0, n = 12*n + 1; sumdiv( n, d, (d%4==1) - (d%4==3)))}; /* Michael Somos, Sep 19 2005 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A) * eta(x^3 + A)^2 / (eta(x + A) * eta(x^6 + A)))^2, n))}; /* Michael Somos, Jun 02 2012 */

Formula

Expansion of (phi(-x^3) / chi(-x))^2 in powers of x where phi(), chi() are Ramanujan theta functions.
Expansion of q^(-1/12) * (eta(q^2) * eta(q^3)^2 / (eta(q) * eta(q^6)))^2 in powers of q. - Michael Somos, Sep 19 2005
Euler transform of period 6 sequence [ 2, 0, -2, 0, 2, -2, ...]. - Michael Somos, Sep 19 2005
G.f. is a period 1 Fourier series which satisfies f(-1 / (72 t)) = 2 (t/i) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A258279. - Michael Somos, May 25 2015
From Michael Somos, Jun 02 2012: (Start)
a(n) = A008441(3*n) = A121363(3*n) = A122865(4*n) = A122856(8*n).
a(n) = A116604(6*n) = A125079(6*n) = A129447(6*n) = A138741(6*n).
From Michael Somos, May 25 2015: (Start)
a(n) = A258277(4*n) = A258278(8*n) = A258291(3*n).
a(n) = - A258210(12*n + 1) = A258228(12*n + 1) = A258256(12*n + 1).
2*a(n) = A258279(12*n + 1) = - A258292(12*n + 1). (End)
G.f.: (Sum_{k = -oo..oo} x^(k*(3*k-1)/2))^2. - Ilya Gutkovskiy, Aug 14 2017
G.f.: ( Product_{n >= 1} (1 + q^n)*(1 - q^(3*n))/(1 + q^(3*n)) )^2. - Peter Bala, Jan 05 2025

A121444 Expansion of f(x^3, x^9) * f(x, x^2) in powers of x where f(, ) is Ramanujan's general theta functions.

Original entry on oeis.org

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

Author

Michael Somos, Jul 30 2006

Keywords

Comments

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

Examples

			G.f. = 1 + x + x^2 + x^3 + x^4 + 2*x^5 + x^7 + x^8 + x^9 + 2*x^10 + x^11 + ...
G.f. = q^5 + q^17 + q^29 + q^41 + q^53 + 2*q^65 + q^89 + q^101 + q^113 + ...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := If[ n < 0, 0, Sum[ I^d, {d, Divisors[12 n + 5]}] / (2 I)]; (* Michael Somos, Jul 25 2015 *)
    a[ n_] := SeriesCoefficient[ 2 x^(3/8) QPochhammer[ x^6]^3 / (QPochhammer[ x, x^2] EllipticTheta[ 2, 0, x^(3/2)]), {x, 0, n}]; (* Michael Somos, Jan 31 2015 *)
    a[ n_] := Length @ FindInstance[ 24 n + 10 == (6 j + 3)^2 + (6 k + 1)^2 && j >= 0, {j, k}, Integers, 10^9]; (* Michael Somos, Jul 02 2015 *)
    a[ n_] := If[ n < 0, 0, DivisorSum[ 12 n + 5, KroneckerSymbol[ -4, #] &] / 2]; (* Michael Somos, Nov 11 2015 *)
    a[ n_] := If[ n < 0, 0, Sum[ Boole[ Mod[d, 4] == 1] - Boole[ Mod[d, 4] == 3], {d, Divisors[12 n + 5]}] / 2]; (* Michael Somos, Nov 11 2015 *)
    a[ n_] := SeriesCoefficient[ QPochhammer[ -x, x] QPochhammer[ x^3] QPochhammer[ x^6], {x, 0, n}]; (* Michael Somos, Nov 11 2015 *)
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A) * eta(x^3 + A) * eta(x^6 + A) / eta(x + A), n))};
    
  • PARI
    {a(n) = if( n<0, 0, n = 12*n + 5; sumdiv(n, d, (d%4==1) - (d%4==3)) / 2)};

Formula

Expansion of f(-x^3) * f(-x^6) / chi(-x) in powers of x where chi(), f() are Ramanujan theta functions.
Expansion of q^(-5/12) * eta(q^2) * eta(q^3) * eta(q^6) / eta(q) in powers of q.
Euler transform of period 6 sequence [ 1, 0, 0, 0, 1, -2, ...].
G.f. is a period 1 Fourier series which satisfies f(-1 / (72 t)) = (t/i) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A258210.
G.f.: Product_{k>0} (1 + x^k) * (1 - x^(3*k)) * (1 - x^(6*k)).
-2 * a(n) = A121363(3*n + 1).
Convolution square is A098098.
a(n) = (-1)^n * A258832(n) = A052343(3*n + 1). -a(n) = A258291(3*n + 1). 2 * a(n) = A008441(3*n + 1). - Michael Somos, Jul 02 2015
From Peter Bala, Jan 07 2021: (Start)
G.f. A(x) = Sum_{n = -oo..oo} x^n/(1 - x^(12*n + 5)). See Agarwal, p. 285, equation 6.19.
A(x^2) = Sum_{n = -oo..oo} x^(2*n)/(1 - x^(12*n + 5)). Cf. A033761. (End)

A052343 Number of ways to write n as the unordered sum of two triangular numbers (zero allowed).

Original entry on oeis.org

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

Author

Christian G. Bower, Jan 23 2000

Keywords

Comments

Number of ways of writing n as a sum of a square and twice a triangular number (zeros allowed). - Michael Somos, Aug 18 2003
a(A020757(n))=0; a(A020756(n))>0; a(A119345(n))=1; a(A118139(n))>1. - Reinhard Zumkeller, May 15 2006
Also, number of ways to write 4n+1 as the unordered sum of two squares of nonnegative integers. - Vladimir Shevelev, Jan 21 2009
The average value of a(n) for n <= x is Pi/4 + O(1/sqrt(x)). - Vladimir Shevelev, Feb 06 2009

Examples

			G.f. = 1 + x + x^2 + x^3 + x^4 + 2*x^6 + x^7 + x^9 + x^10 + x^11 + ...
		

Programs

  • Haskell
    a052343 = (flip div 2) . (+ 1) . a008441
    -- Reinhard Zumkeller, Jul 25 2014
  • Maple
    A052343 := proc(n)
        local a,t1idx,t2idx,t1,t2;
        a := 0 ;
        for t1idx from 0 do
            t1 := A000217(t1idx) ;
            if t1 > n then
                break;
            end if;
            for t2idx from t1idx do
                t2 := A000217(t2idx) ;
                if t1+t2 > n then
                    break;
                elif t1+t2 = n then
                    a := a+1 ;
                end if;
            end do:
        end do:
        a ;
    end proc: # R. J. Mathar, Apr 28 2020
  • Mathematica
    Length[PowersRepresentations[4 # + 1, 2, 2]] & /@ Range[0, 101] (* Ant King, Dec 01 2010 *)
    d1[k_]:=Length[Select[Divisors[k],Mod[#,4]==1&]];d3[k_]:=Length[Select[Divisors[k],Mod[#,4]==3&]];f[k_]:=d1[k]-d3[k];g[k_]:=If[IntegerQ[Sqrt[4k+1]],1/2 (f[4k+1]+1),1/2 f[4k+1]];g[#]&/@Range[0,101] (* Ant King, Dec 01 2010 *)
    a[ n_] := Length @ Select[ Table[ Sqrt[n - i - i^2], {i, 0, Quotient[ Sqrt[4 n + 1] - 1, 2]}], IntegerQ]; (* Michael Somos, Jul 28 2015 *)
    a[ n_] := Length @ FindInstance[ {j >= 0, k >= 0, j^2 + k^2 + k == n}, {k, j}, Integers, 10^9]; (* Michael Somos, Jul 28 2015 *)
  • PARI
    {a(n) = if( n<0, 0, sum(i=0, (sqrtint(4*n + 1) - 1)\2, issquare(n - i - i^2)))}; /* Michael Somos, Aug 18 2003 */
    

Formula

a(n) = ceiling(A008441(n)/2). - Reinhard Zumkeller, Nov 03 2009
G.f.: (Sum_{k>=0} x^(k^2 + k)) * (Sum_{k>=0} x^(k^2)). - Michael Somos, Aug 18 2003
Recurrence: a(n) = Sum_{k=1..r(n)} r(2n-k^2+k) - C(r(n),2) - a(n-1) - a(n-2) - ... - a(0), n>=1,a (0)=1, where r(n)=A000194(n+1) is the nearest integer to square root of n+1. For example, since r(6)=3, a(6) = r(12) + r(10) + r(6) - C(3,2) - a(5) - ... - a(0) = 4 + 3 + 3 - 3 - 0 - 1 - 1 - 1 - 1 - 1 = 2. - Vladimir Shevelev, Feb 06 2009
a(n) = A025426(8n+2). - Max Alekseyev, Mar 09 2009
a(n) = (A002654(4n+1) + A010052(4n+1)) / 2. - Ant King, Dec 01 2010
a(2*n + 1) = A053692(n). a(4*n + 1) = A259287(n). a(4*n + 3) = A259285(n). a(6*n + 1) = A260415(n). a(6*n + 4) = A260516(n). - Michael Somos, Jul 28 2015
a(3*n) = A093518(n). a(3*n + 1) = A121444(n). a(9*n + 2) = a(n). a(9*n + 5) = a(9*n + 8) = 0. - Michael Somos, Jul 28 2015
Convolution of A005369 and A010052. - Michael Somos, Jul 28 2015

A079006 Expansion of q^(-1/4) * (eta(q) * eta(q^4)^2 / eta(q^2)^3)^2 in powers of q.

Original entry on oeis.org

1, -2, 5, -10, 18, -32, 55, -90, 144, -226, 346, -522, 777, -1138, 1648, -2362, 3348, -4704, 6554, -9056, 12425, -16932, 22922, -30848, 41282, -54946, 72768, -95914, 125842, -164402, 213901, -277204, 357904, -460448, 590330, -754368, 960948, -1220370
Offset: 0

Author

Michael Somos, Dec 22 2002

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
The Lagrange series reversion of Sum_{n >= 1} a(n-1)*x^n is Sum_{n >= 1} A002103(n-1)*x^n. See the example in A002103. - Wolfdieter Lang, Jul 09 2016

Examples

			G.f. A(x) = 1 - 2*x + 5*x^2 - 10*x^3 + 18*x^4 - 32*x^5 + 55*x^6 - 90*x^7 + 144*x^8 + ...
G.f. B(q) = q * A(q^4) = q - 2*q^5 + 5*q^9 - 10*q^13 + 18*q^17 - 32*q^21 + 55*q^25 - 90*q^29 + ...
		

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.
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; Eq. (34.3).

Programs

  • Mathematica
    a[ n_] := SeriesCoefficient[ Product[(1 + x^(k + 1)) / (1 + x^k), {k, 1, n, 2}]^2, {x, 0, n}]; (* Michael Somos, Jul 08 2011 *)
    a[ n_] := With[ {m = InverseEllipticNomeQ[ q]}, SeriesCoefficient[ (m / 16 / q)^(1/4), {q, 0, n}]]; (* Michael Somos, Jul 08 2011 *)
    QP = QPochhammer; s = (QP[q]*(QP[q^4]^2/QP[q^2]^3))^2 + O[q]^40; CoefficientList[s, q] (* Jean-François Alcover, Nov 23 2015 *)
    nmax = 50; CoefficientList[Series[Product[(1+x^(2*k))^4 / (1+x^k)^2, {k, 1, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Jul 04 2016 *)
    a[ n_] := SeriesCoefficient[ QPochhammer[ x^4]^2 / QPochhammer[ -x]^2, {x, 0, n}]; (* Michael Somos, Apr 19 2017 *)
  • PARI
    {a(n) = my(N, A); if( n<0, 0, N = (sqrtint(16*n + 1) + 1)\2; A = contfracpnqn( matrix(2, N, i, j, if( i==1, if( j<2, 1 + O(x^(N^2 + N)), (x^(j-1) + x^(3*j - 3))^2), 1 - x^(4*j - 2)))); polcoeff( A[2,1] / A[1,1], 4*n))}; /* Michael Somos, Sep 01 2005 */
    
  • PARI
    {a(n) = my(A, m); if( n<0, 0, A = 1 + O(x); m = 1; while( m<=n, m*=2; A = subst(A, x, x^2); A = sqrt(A / (1 + 4 * x*A^2))); polcoeff(A, n))};
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x + A) * eta(x^4 + A)^2 / eta(x^2 + A)^3)^2, n))};

Formula

a(n) = (2/n)*Sum_{k=1..n} (-1)^k*A046897(k)*a(n-k). - Vladeta Jovovic, Dec 24 2002
Expansion of q^(-1/4) * (1/2) * k^(1/2) in powers of q, where k^2 is the parameter and q the Jacobi nome of elliptic functions.
Expansion of (1/(2*q)) * (1 - sqrt(k')) / (1 + sqrt(k')) in powers of q^4, where k'^2 is the complementary parameter and q the Jacobi nome of elliptic functions. See the Fricke reference.
Expansion of psi(x^2) / phi(x) = psi(x)^2 / phi(x)^2 = psi(x^2)^2 / psi(x)^2 = psi(-x)^2 / phi(-x^2)^2 = chi(-x)^2 / chi(-x^2)^4 = 1 / (chi(x)^2 * chi(-x^2)^2) = 1 / (chi(x)^4 * chi(-x)^2) = f(-x^4)^2 / f(x)^2 in powers of x where phi(), psi(), chi(), f() are Ramanujan theta functions.
Euler transform of period 4 sequence [-2, 4, -2, 0, ...].
G.f. A(x) satisfies A(x)^2 = A(x^2) / (1 + 4 * x * A(x^2)^2). - Michael Somos, Mar 19 2004
Given g.f. A(x), then B(q) = q * A(q^4) satisfies 0 = f(B(q), B(q^2)) where f(u, v) = u^2 * (1 + 4 * v^2) - v. - Michael Somos, Jul 09 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 * (u6 + u2)^2 - u2*u6. - Michael Somos, Jul 09 2005
G.f.: (Product_{k>0} (1 + x^(2*k)) / (1 + x^(2*k-1)))^2 = (Product_{k>0} (1 - x^(4*k)) / (1 - (-x)^k))^2.
Expansion of continued fraction 1 / (1 - x^2 + (x^1 + x^3)^2 / (1 - x^6 + (x^2 + x^6)^2 / (1 - x^10 + (x^3 + x^9)^2 / ...))) in powers of x^4. - Michael Somos, Sep 01 2005
Given g.f. A(x), then B(q) = 2 * q * A(q^4) satisfies 0 = f(B(q), B(q^3)) where f(u, v) = (1 - u^4) * (1 - v^4) - (1 - u*v)^4 . - Michael Somos, Jan 01 2006
G.f. is a period 1 Fourier series which satisfies f(-1 / (16 t)) = (1/2) g(t) where q = exp(2 Pi i t) and g() is g.f. for A189925.
Convolution inverse of A029839. Convolution square of A083365. a(n) = (-1)^n * A001936(n).
G.f.: 1/Q(0), where Q(k)= 1 - x^(k+1/2) + (x^((k+1)/4) + x^((3*k+3)/4))^2/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, May 02 2013
a(n) ~ (-1)^n * exp(Pi*sqrt(n)) / (2^(7/2)*n^(3/4)). - Vaclav Kotesovec, Jul 04 2016
Given g.f. A(x), and B(x) is the g.f. for A008441, then A(x) = B(x^2) / B(x) and A(x) * A(x^2) * A(x^4) * ... = 1 / B(x). - Michael Somos, Apr 20 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
a(n) = A208933(4*n+1) - A215348(4*n+1) (conjectured). - Thomas Baruchel, May 14 2018
A(x^4) = (1/(m*x)) * ( chi(x)^m - chi(-x)^m ) / ( chi(x)^m + chi(-x)^m ) at m = 2, where chi(x) = Product_{i >= 0} (1 + x^(2*i+1)) is the g.f. of A000700. The formula gives generating functions related to A092869 when m = 1 and A001938 (also A093160) when m = 4. - Peter Bala, Sep 23 2023
Showing 1-10 of 66 results. Next