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

A295291 Indices of primes in sequence A000700.

Original entry on oeis.org

8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 20, 24, 29, 32, 35, 38, 39, 51, 56, 61, 77, 82, 88, 90, 91, 92, 107, 118, 119, 123, 139, 148, 161, 162, 166, 185, 189, 190, 194, 208, 214, 333, 346, 355, 373, 401, 402, 493, 543, 567, 578, 603, 629, 653, 665, 666, 678
Offset: 1

Views

Author

Vaclav Kotesovec, Nov 19 2017

Keywords

Examples

			51 is in the sequence because A000700(51) = 107 is prime.
		

Crossrefs

A274352 Convolution of A015723 and A000700.

Original entry on oeis.org

0, 1, 2, 4, 7, 10, 18, 26, 36, 53, 76, 104, 140, 190, 252, 336, 437, 564, 732, 936, 1186, 1504, 1894, 2366, 2950, 3659, 4520, 5564, 6822, 8330, 10152, 12326, 14906, 17996, 21662, 25996, 31135, 37190, 44314, 52704, 62532, 74036, 87504, 103212, 121496, 142798
Offset: 0

Views

Author

R. J. Mathar, Jun 18 2016

Keywords

Comments

Also the convolution of A080054 and A048272.

Crossrefs

Programs

  • Maple
    with(numtheory):
    b:= proc(n) option remember; `if`(n=0, 1, add(add(d*
         [0, 2, -1, 2][1+irem(d, 4)], d=divisors(j))*b(n-j), j=1..n)/n)
        end:
    g:= proc(n) option remember; add((-1)^(d+1), d=divisors(n)) end:
    a:= n-> add(b(j)*g(n-j), j=0..n):
    seq(a(n), n=0..60);  # Alois P. Heinz, Jun 18 2016
  • Mathematica
    q[n_, k_] := q[n, k] = If[n < k || k < 1, 0, If[n == 1, 1, q[n - k, k] + q[n - k, k - 1]]]; Table[Sum[SeriesCoefficient[Product[1 + x^j, {j, 1, k, 2}], {x, 0, k}] Sum[i q[#, i], {i, 1, Floor[(Sqrt[8 # + 1] - 1)/2]}] &[n - k], {k, 0, n}], {n, 0, 45}] (* Michael De Vlieger, Jun 18 2016, after Vaclav Kotesovec at A015723 and Vladimir Reshetnikov at A000700 *)

Formula

a(n) = Sum_{k=0..n} A015723(k)*A000700(n-k).
a(n) ~ log(2) * exp(Pi*sqrt(n/2)) / (Pi * 2^(3/4) * n^(1/4)). - Vaclav Kotesovec, Sep 14 2021

A304044 Numbers k such that A000700(k) is divisible by k.

Original entry on oeis.org

1, 2, 67, 18979, 85417
Offset: 1

Views

Author

Vaclav Kotesovec, May 05 2018

Keywords

Comments

No other terms below 2000000. - Vaclav Kotesovec, Sep 09 2021

Examples

			67 is in the sequence because A000700(67) = 335 = 5 * 67.
		

Crossrefs

Cf. A000700.

A366104 G.f. ( Chi(sqrt(x))^4 + Chi(-sqrt(x))^4 )/2, where Chi(x) = Product_{k >= 0} 1 + x^(2*k+1) is the g.f. of A000700.

Original entry on oeis.org

1, 6, 17, 38, 84, 172, 325, 594, 1049, 1796, 3005, 4912, 7877, 12430, 19309, 29580, 44766, 66978, 99150, 145374, 211242, 304382, 435194, 617674, 870651, 1219352, 1697283, 2348888, 3232919, 4426546, 6030872, 8177986, 11039633, 14838518, 19862613, 26482878, 35175989, 46552818, 61393694
Offset: 0

Views

Author

Peter Bala, Sep 29 2023

Keywords

Comments

Compare with A224916 with g.f. ( Chi(sqrt(x))^4 - Chi(-sqrt(x))^4 )/(8*sqrt(x)),
A069910 with g.f. ( Chi(sqrt(x)) + Chi(-sqrt(x)) )/2,
A069911 with g.f. ( Chi(sqrt(x)) - Chi(-sqrt(x)) )/2,
A226622 with g.f. ( Chi(sqrt(x))^2 + Chi(-sqrt(x))^2 )/2 and
A226635 with g.f. ( Chi(sqrt(x))^2 - Chi(-sqrt(x))^2 )/(4*sqrt(x)),
Jacobi's "aequatio identica satis abstrusa" is the identity ( Chi(sqrt(x))^8 - Chi(-sqrt(x))^8 )/(16*sqrt(x)) = Product_{k >= 1} (1 + x^k)^8.

Crossrefs

Programs

  • Maple
    with(QDifferenceEquations):
     seq(coeff((1/2)*expand(QPochhammer(-q,q^2,40)^4 + QPochhammer(q,q^2,40)^4), q, 2*n), n = 0..40);
    #alternative program
    seq(coeff(expand(QPochhammer(-q^2, q^2, 20)^2 * QPochhammer(-q, q^2, 20)^6), q, n), n = 0..40);
  • Mathematica
    nmax = 40; CoefficientList[Series[Product[(1 + x^(2*k))^2 * (1 + x^(2*k-1))^6, {k, 1, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Jun 29 2025 *)

Formula

G.f.: Product_{k >= 1} (1 + x^(2*k))^2*(1 + x^(2*k-1))^6.
G.f.: x^(1/12) * eta(x^2)^10 * eta(x^4)^2 / ( eta(x) * eta(x^4) )^6.
a(n) ~ exp(2*Pi*sqrt(n/3)) / (4 * 3^(1/4) * n^(3/4)). - Vaclav Kotesovec, Jun 29 2025

A000041 a(n) is the number of partitions of n (the partition numbers).

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, 627, 792, 1002, 1255, 1575, 1958, 2436, 3010, 3718, 4565, 5604, 6842, 8349, 10143, 12310, 14883, 17977, 21637, 26015, 31185, 37338, 44583, 53174, 63261, 75175, 89134, 105558, 124754, 147273, 173525
Offset: 0

Views

Author

Keywords

Comments

Also number of nonnegative solutions to b + 2c + 3d + 4e + ... = n and the number of nonnegative solutions to 2c + 3d + 4e + ... <= n. - Henry Bottomley, Apr 17 2001
a(n) is also the number of conjugacy classes in the symmetric group S_n (and the number of irreducible representations of S_n).
Also the number of rooted trees with n+1 nodes and height at most 2.
Coincides with the sequence of numbers of nilpotent conjugacy classes in the Lie algebras gl(n). A006950, A015128 and this sequence together cover the nilpotent conjugacy classes in the classical A,B,C,D series of Lie algebras. - Alexander Elashvili, Sep 08 2003
Number of distinct Abelian groups of order p^n, where p is prime (the number is independent of p). - Lekraj Beedassy, Oct 16 2004
Number of graphs on n vertices that do not contain P3 as an induced subgraph. - Washington Bomfim, May 10 2005
Numbers of terms to be added when expanding the n-th derivative of 1/f(x). - Thomas Baruchel, Nov 07 2005
Sequence agrees with expansion of Molien series for symmetric group S_n up to the term in x^n. - Maurice D. Craig (towenaar(AT)optusnet.com.au), Oct 30 2006
Also the number of nonnegative integer solutions to x_1 + x_2 + x_3 + ... + x_n = n such that n >= x_1 >= x_2 >= x_3 >= ... >= x_n >= 0, because by letting y_k = x_k - x_(k+1) >= 0 (where 0 < k < n) we get y_1 + 2y_2 + 3y_3 + ... + (n-1)y_(n-1) + nx_n = n. - Werner Grundlingh (wgrundlingh(AT)gmail.com), Mar 14 2007
Let P(z) := Sum_{j>=0} b_j z^j, b_0 != 0. Then 1/P(z) = Sum_{j>=0} c_j z^j, where the c_j must be computed from the infinite triangular system b_0 c_0 = 1, b_0 c_1 + b_1 c_0 = 0 and so on (Cauchy products of the coefficients set to zero). The n-th partition number arises as the number of terms in the numerator of the expression for c_n: The coefficient c_n of the inverted power series is a fraction with b_0^(n+1) in the denominator and in its numerator having a(n) products of n coefficients b_i each. The partitions may be read off from the indices of the b_i. - Peter C. Heinig (algorithms(AT)gmx.de), Apr 09 2007
A sequence of positive integers p = p_1 ... p_k is a descending partition of the positive integer n if p_1 + ... + p_k = n and p_1 >= ... >= p_k. If formally needed p_j = 0 is appended to p for j > k. Let P_n denote the set of these partition for some n >= 1. Then a(n) = 1 + Sum_{p in P_n} floor((p_1-1)/(p_2+1)). (Cf. A000065, where the formula reduces to the sum.) Proof in Kelleher and O'Sullivan (2009). For example a(6) = 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 2 + 5 = 11. - Peter Luschny, Oct 24 2010
Let n = Sum( k_(p_m) p_m ) = k_1 + 2k_2 + 5k_5 + 7k_7 + ..., where p_m is the m-th generalized pentagonal number (A001318). Then a(n) is the sum over all such pentagonal partitions of n of (-1)^(k_5+k_7 + k_22 + ...) ( k_1 + k_2 + k_5 + ...)! /( k_1! k_2! k_5! ...), where the exponent of (-1) is the sum of all the k's corresponding to even-indexed GPN's. - Jerome Malenfant, Feb 14 2011
From Jerome Malenfant, Feb 14 2011: (Start)
The matrix of a(n) values
a(0)
a(1) a(0)
a(2) a(1) a(0)
a(3) a(2) a(1) a(0)
....
a(n) a(n-1) a(n-2) ... a(0)
is the inverse of the matrix
1
-1 1
-1 -1 1
0 -1 -1 1
....
-d_n -d_(n-1) -d_(n-2) ... -d_1 1
where d_q = (-1)^(m+1) if q = m(3m-1)/2 = the m-th generalized pentagonal number (A001318), = 0 otherwise. (End)
Let k > 0 be an integer, and let i_1, i_2, ..., i_k be distinct integers such that 1 <= i_1 < i_2 < ... < i_k. Then, equivalently, a(n) equals the number of partitions of N = n + i_1 + i_2 + ... + i_k in which each i_j (1 <= j <= k) appears as a part at least once. To see this, note that the partitions of N of this class must be in 1-to-1 correspondence with the partitions of n, since N - i_1 - i_2 - ... - i_k = n. - L. Edson Jeffery, Apr 16 2011
a(n) is the number of distinct degree sequences over all free trees having n + 2 nodes. Take a partition of the integer n, add 1 to each part and append as many 1's as needed so that the total is 2n + 2. Now we have a degree sequence of a tree with n + 2 nodes. Example: The partition 3 + 2 + 1 = 6 corresponds to the degree sequence {4, 3, 2, 1, 1, 1, 1, 1} of a tree with 8 vertices. - Geoffrey Critzer, Apr 16 2011
a(n) is number of distinct characteristic polynomials among n! of permutations matrices size n X n. - Artur Jasinski, Oct 24 2011
Conjecture: starting with offset 1 represents the numbers of ordered compositions of n using the signed (++--++...) terms of A001318 starting (1, 2, -5, -7, 12, 15, ...). - Gary W. Adamson, Apr 04 2013 (this is true by the pentagonal number theorem, Joerg Arndt, Apr 08 2013)
a(n) is also number of terms in expansion of the n-th derivative of log(f(x)). In Mathematica notation: Table[Length[Together[f[x]^n * D[Log[f[x]], {x, n}]]], {n, 1, 20}]. - Vaclav Kotesovec, Jun 21 2013
Conjecture: No a(n) has the form x^m with m > 1 and x > 1. - Zhi-Wei Sun, Dec 02 2013
Partitions of n that contain a part p are the partitions of n - p. Thus, number of partitions of m*n - r that include k*n as a part is A000041(h*n-r), where h = m - k >= 0, n >= 2, 0 <= r < n; see A111295 as an example. - Clark Kimberling, Mar 03 2014
a(n) is the number of compositions of n into positive parts avoiding the pattern [1, 2]. - Bob Selcoe, Jul 08 2014
Conjecture: For any j there exists k such that all primes p <= A000040(j) are factors of one or more a(n) <= a(k). Growth of this coverage is slow and irregular. k = 1067 covers the first 102 primes, thus slower than A000027. - Richard R. Forberg, Dec 08 2014
a(n) is the number of nilpotent conjugacy classes in the order-preserving, order-decreasing and (order-preserving and order-decreasing) injective transformation semigroups. - Ugbene Ifeanyichukwu, Jun 03 2015
Define a segmented partition a(n,k, ) to be a partition of n with exactly k parts, with s(j) parts t(j) identical to each other and distinct from all the other parts. Note that n >= k, j <= k, 0 <= s(j) <= k, s(1)t(1) + ... + s(j)t(j) = n and s(1) + ... + s(j) = k. Then there are up to a(k) segmented partitions of n with exactly k parts. - Gregory L. Simay, Nov 08 2015
(End)
From Gregory L. Simay, Nov 09 2015: (Start)
The polynomials for a(n, k, ) have degree j-1.
a(n, k, ) = 1 if n = 0 mod k, = 0 otherwise
a(rn, rk, ) = a(n, k, )
a(n odd, k, ) = 0
Established results can be recast in terms of segmented partitions:
For j(j+1)/2 <= n < (j+1)(j+2)/2, A000009(n) = a(n, 1, <1>) + ... + a(n, j, ), j < n
a(n, k, ) = a(n - j(j-1)/2, k)
(End)
a(10^20) was computed using the NIST Arb package. It has 11140086260 digits and its head and tail sections are 18381765...88091448. See the Johansson 2015 link. - Stanislav Sykora, Feb 01 2016
Satisfies Benford's law [Anderson-Rolen-Stoehr, 2011]. - N. J. A. Sloane, Feb 08 2017
The partition function p(n) is log-concave for all n>25 [DeSalvo-Pak, 2014]. - Michel Marcus, Apr 30 2019
a(n) is also the dimension of the n-th cohomology of the infinite real Grassmannian with coefficients in Z/2. - Luuk Stehouwer, Jun 06 2021
Number of equivalence relations on n unlabeled nodes. - Lorenzo Sauras Altuzarra, Jun 13 2022
Equivalently, number of idempotent mappings f from a set X of n elements into itself (i.e., satisfying f o f = f) up to permutation (i.e., f~f' :<=> There is a permutation sigma in Sym(X) such that f' o sigma = sigma o f). - Philip Turecek, Apr 17 2023
Conjecture: Each integer n > 2 different from 6 can be written as a sum of finitely many numbers of the form a(k) + 2 (k > 0) with no summand dividing another. This has been verified for n <= 7140. - Zhi-Wei Sun, May 16 2023
a(n) is also the number of partitions of n*(n+3)/2 into n distinct parts. - David García Herrero, Aug 20 2024
a(n) is also the number of non-isomorphic sigma algebras on {1,...,n}. A000110(n) counts all sigma algebras on {1,...,n}. Every sigma algebra on a finite set X is exactly the collection of all unions of its atoms (its minimal nonempty members), and those atoms partition X. An isomorphism of sigma algebras must map atoms to atoms, so the isomorphism class of a sigma algebra is determined by the multiset of its atom-sizes, which is an integer partition of n. - Matthew Azar, Jul 18 2025

Examples

			a(5) = 7 because there are seven partitions of 5, namely: {1, 1, 1, 1, 1}, {2, 1, 1, 1}, {2, 2, 1}, {3, 1, 1}, {3, 2}, {4, 1}, {5}. - _Bob Selcoe_, Jul 08 2014
G.f. = 1 + x + 2*x^2 + 3*x^3 + 5*x^4 + 7*x^5 + 11*x^6 + 15*x^7 + 22*x^8 + ...
G.f. = 1/q + q^23 + 2*q^47 + 3*q^71 + 5*q^95 + 7*q^119 + 11*q^143 + 15*q^167 + ...
From _Gregory L. Simay_, Nov 08 2015: (Start)
There are up to a(4)=5 segmented partitions of the partitions of n with exactly 4 parts. They are a(n,4, <4>), a(n,4,<3,1>), a(n,4,<2,2>), a(n,4,<2,1,1>), a(n,4,<1,1,1,1>).
The partition 8,8,8,8 is counted in a(32,4,<4>).
The partition 9,9,9,5 is counted in a(32,4,<3,1>).
The partition 11,11,5,5 is counted in a(32,4,<2,2>).
The partition 13,13,5,1 is counted in a(32,4,<2,1,1>).
The partition 14,9,6,3 is counted in a(32,4,<1,1,1,1>).
a(n odd,4,<2,2>) = 0.
a(12, 6, <2,2,2>) = a(6,3,<1,1,1>) = a(6-3,3) = a(3,3) = 1. The lone partition is 3,3,2,2,1,1.
(End)
		

References

  • George E. Andrews, The Theory of Partitions, Addison-Wesley, Reading, Mass., 1976.
  • George E. Andrews and K. Ericksson, Integer Partitions, Cambridge University Press 2004.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 307.
  • R. Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; Chapter III.
  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education Journal, Vol. 31, No. 1, pp. 24-28, Winter 1997.
  • 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.
  • Bruce C. Berndt, Ramanujan's Notebooks Part V, Springer-Verlag.
  • B. C. Berndt, Number Theory in the Spirit of Ramanujan, Chap. I Amer. Math. Soc. Providence RI 2006.
  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 999.
  • J. M. Borwein, D. H. Bailey and R. Girgensohn, Experimentation in Mathematics, A K Peters, Ltd., Natick, MA, 2004. x+357 pp. See p. 183.
  • Florian Cajori, A History of Mathematical Notations, Dover edition (2012), par. 411.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 94-96.
  • L. E. Dickson, History of the Theory of Numbers, Vol.II Chapter III pp. 101-164, Chelsea NY 1992.
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 37, Eq. (22.13).
  • H. Gupta et al., Tables of Partitions. Royal Society Mathematical Tables, Vol. 4, Cambridge Univ. Press, 1958, p. 90.
  • G. H. Hardy and S. Ramanujan, Asymptotic formulas in combinatorial analysis, Proc. London Math. Soc., 17 (1918), 75-.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, pp. 83-100, 113-131.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers (Fifth edition), Oxford Univ. Press (Clarendon), 1979, 273-296.
  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.4, p. 396.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section XIV.1, p. 491.
  • S. Ramanujan, Collected Papers, Chap. 25, Cambridge Univ. Press 1927 (Proceedings of the Camb. Phil. Soc., 19 (1919), pp. 207-213).
  • S. Ramanujan, Collected Papers, Chap. 28, Cambridge Univ. Press 1927 (Proceedings of the London Math. Soc., 2, 18(1920)).
  • S. Ramanujan, Collected Papers, Chap. 30, Cambridge Univ. Press 1927 (Mathematische Zeitschrift, 9 (1921), pp. 147-163).
  • S. Ramanujan, Collected Papers, Ed. G. H. Hardy et al., Cambridge 1927; Chelsea, NY, 1962. See Table IV on page 308.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 122.
  • J. E. Roberts, Lure of the Integers, pp. 168-9 MAA 1992.
  • 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).
  • R. E. Tapscott and D. Marcovich, "Enumeration of Permutational Isomers: The Porphyrins", Journal of Chemical Education, 55 (1978), 446-447.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 286-289, 297-298, 303.
  • Robert M. Young, "Excursions in Calculus", Mathematical Association of America, p. 367.

Crossrefs

Partial sums give A000070.
For successive differences see A002865, A053445, A072380, A081094, A081095.
Antidiagonal sums of triangle A092905. a(n) = A054225(n,0).
Boustrophedon transforms: A000733, A000751.
Cf. A167376 (complement), A061260 (multisets), A000700 (self-conjug), A330644 (not self-conj).

Programs

  • GAP
    List([1..10],n->Size(OrbitsDomain(SymmetricGroup(IsPermGroup,n),SymmetricGroup(IsPermGroup,n),\^))); # Attila Egri-Nagy, Aug 15 2014
    
  • Haskell
    import Data.MemoCombinators (memo2, integral)
    a000041 n = a000041_list !! n
    a000041_list = map (p' 1) [0..] where
       p' = memo2 integral integral p
       p _ 0 = 1
       p k m = if m < k then 0 else p' k (m - k) + p' (k + 1) m
    -- Reinhard Zumkeller, Nov 03 2015, Nov 04 2013
    
  • Julia
    # DedekindEta is defined in A000594
    A000041List(len) = DedekindEta(len, -1)
    A000041List(50) |> println # Peter Luschny, Mar 09 2018
  • Magma
    a:= func< n | NumberOfPartitions(n) >; [ a(n) : n in [0..10]];
    
  • Maple
    A000041 := n -> combinat:-numbpart(n): [seq(A000041(n), n=0..50)]; # Warning: Maple 10 and 11 give incorrect answers in some cases: A110375.
    spec := [B, {B=Set(Set(Z,card>=1))}, unlabeled ];
    [seq(combstruct[count](spec, size=n), n=0..50)];
    with(combstruct):ZL0:=[S,{S=Set(Cycle(Z,card>0))}, unlabeled]: seq(count(ZL0,size=n),n=0..45); # Zerinvary Lajos, Sep 24 2007
    G:={P=Set(Set(Atom,card>0))}: combstruct[gfsolve](G,labeled,x); seq(combstruct[count]([P,G,unlabeled],size=i),i=0..45); # Zerinvary Lajos, Dec 16 2007
    # Using the function EULER from Transforms (see link at the bottom of the page).
    1,op(EULER([seq(1,n=1..49)])); # Peter Luschny, Aug 19 2020
  • Mathematica
    Table[ PartitionsP[n], {n, 0, 45}]
    a[ n_] := SeriesCoefficient[ q^(1/24) / DedekindEta[ Log[q] / (2 Pi I)], {q, 0, n}]; (* Michael Somos, Jul 11 2011 *)
    a[ n_] := SeriesCoefficient[ 1 / Product[ 1 - x^k, {k, n}], {x, 0, n}]; (* Michael Somos, Jul 11 2011 *)
    CoefficientList[1/QPochhammer[q] + O[q]^100, q] (* Jean-François Alcover, Nov 25 2015 *)
    a[0] := 1; a[n_] := a[n] = Block[{k=1, s=0, i=n-1}, While[i >= 0, s=s-(-1)^k (a[i]+a[i-k]); k=k+1; i=i-(3 k-2)]; s]; Map[a, Range[0, 49]] (* Oliver Seipel, Jun 01 2024 after Euler *)
  • Maxima
    num_partitions(60,list); /* Emanuele Munarini, Feb 24 2014 */
    
  • MuPAD
    combinat::partitions::count(i) $i=0..54 // Zerinvary Lajos, Apr 16 2007
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( 1 / eta(x + x * O(x^n)), n))};
    
  • PARI
    /* The Hardy-Ramanujan-Rademacher exact formula in PARI is as follows (this is no longer necessary since it is now built in to the numbpart command): */
    Psi(n, q) = local(a, b, c); a=sqrt(2/3)*Pi/q; b=n-1/24; c=sqrt(b); (sqrt(q)/(2*sqrt(2)*b*Pi))*(a*cosh(a*c)-(sinh(a*c)/c))
    L(n, q) = if(q==1,1,sum(h=1,q-1,if(gcd(h,q)>1,0,cos((g(h,q)-2*h*n)*Pi/q))))
    g(h, q) = if(q<3,0,sum(k=1,q-1,k*(frac(h*k/q)-1/2)))
    part(n) = round(sum(q=1,max(5,0.5*sqrt(n)),L(n,q)*Psi(n,q)))
    /* Ralf Stephan, Nov 30 2002, fixed by Vaclav Kotesovec, Apr 09 2018 */
    
  • PARI
    {a(n) = numbpart(n)};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum( k=1, sqrtint(n), x^k^2 / prod( i=1, k, 1 - x^i, 1 + x * O(x^n))^2, 1), n))};
    
  • PARI
    f(n)= my(v,i,k,s,t);v=vector(n,k,0);v[n]=2;t=0;while(v[1]1,i--;s+=i*(v[i]=(n-s)\i));t++);t \\ Thomas Baruchel, Nov 07 2005
    
  • PARI
    a(n)=if(n<0, 0, polcoeff(exp(sum(k=1, n, x^k/(1-x^k)/k, x*O(x^n))), n)) \\ Joerg Arndt, Apr 16 2010
    
  • Perl
    use ntheory ":all"; my @p = map { partitions($) } 0..100; say "[@p]"; # _Dana Jacobsen, Sep 06 2015
    
  • Python
    from sympy.functions.combinatorial.numbers import partition
    print([partition(i) for i in range(101)]) # Joan Ludevid, May 25 2025
    
  • Racket
    #lang racket
    ; SUM(k,-inf,+inf) (-1)^k p(n-k(3k-1)/2)
    ; For k outside the range (1-(sqrt(1-24n))/6 to (1+sqrt(1-24n))/6) argument n-k(3k-1)/2 < 0.
    ; Therefore the loops below are finite. The hash avoids repeated identical computations.
    (define (p n) ; Nr of partitions of n.
    (hash-ref h n
      (λ ()
       (define r
        (+
         (let loop ((k 1) (n (sub1 n)) (s 0))
          (if (< n 0) s
           (loop (add1 k) (- n (* 3 k) 1) (if (odd? k) (+ s (p n)) (- s (p n))))))
         (let loop ((k -1) (n (- n 2)) (s 0))
          (if (< n 0) s
           (loop (sub1 k) (+ n (* 3 k) -2) (if (odd? k) (+ s (p n)) (- s (p n))))))))
       (hash-set! h n r)
       r)))
    (define h (make-hash '((0 . 1))))
    ; (for ((k (in-range 0 50))) (printf "~s, " (p k))) runs in a moment.
    ; Jos Koot, Jun 01 2016
    
  • Sage
    [number_of_partitions(n) for n in range(46)]  # Zerinvary Lajos, May 24 2009
    
  • Sage
    @CachedFunction
    def A000041(n):
        if n == 0: return 1
        S = 0; J = n-1; k = 2
        while 0 <= J:
            T = A000041(J)
            S = S+T if is_odd(k//2) else S-T
            J -= k if is_odd(k) else k//2
            k += 1
        return S
    [A000041(n) for n in range(50)]  # Peter Luschny, Oct 13 2012
    
  • Sage
    # uses[EulerTransform from A166861]
    a = BinaryRecurrenceSequence(1, 0)
    b = EulerTransform(a)
    print([b(n) for n in range(50)]) # Peter Luschny, Nov 11 2020
    

Formula

G.f.: Product_{k>0} 1/(1-x^k) = Sum_{k>= 0} x^k Product_{i = 1..k} 1/(1-x^i) = 1 + Sum_{k>0} x^(k^2)/(Product_{i = 1..k} (1-x^i))^2.
G.f.: 1 + Sum_{n>=1} x^n/(Product_{k>=n} 1-x^k). - Joerg Arndt, Jan 29 2011
a(n) - a(n-1) - a(n-2) + a(n-5) + a(n-7) - a(n-12) - a(n-15) + ... = 0, where the sum is over n-k and k is a generalized pentagonal number (A001318) <= n and the sign of the k-th term is (-1)^([(k+1)/2]). See A001318 for a good way to remember this!
a(n) = (1/n) * Sum_{k=0..n-1} sigma(n-k)*a(k), where sigma(k) is the sum of divisors of k (A000203).
a(n) ~ 1/(4*n*sqrt(3)) * e^(Pi * sqrt(2n/3)) as n -> infinity (Hardy and Ramanujan). See A050811.
a(n) = a(0)*b(n) + a(1)*b(n-2) + a(2)*b(n-4) + ... where b = A000009.
From Jon E. Schoenfield, Aug 17 2014: (Start)
It appears that the above approximation from Hardy and Ramanujan can be refined as
a(n) ~ 1/(4*n*sqrt(3)) * e^(Pi * sqrt(2n/3 + c0 + c1/n^(1/2) + c2/n + c3/n^(3/2) + c4/n^2 + ...)), where the coefficients c0 through c4 are approximately
c0 = -0.230420145062453320665537
c1 = -0.0178416569128570889793
c2 = 0.0051329911273
c3 = -0.0011129404
c4 = 0.0009573,
as n -> infinity. (End)
From Vaclav Kotesovec, May 29 2016 (c4 added Nov 07 2016): (Start)
c0 = -0.230420145062453320665536704197233... = -1/36 - 2/Pi^2
c1 = -0.017841656912857088979502135349949... = 1/(6*sqrt(6)*Pi) - sqrt(3/2)/Pi^3
c2 = 0.005132991127342167594576391633559... = 1/(2*Pi^4)
c3 = -0.001112940489559760908236602843497... = 3*sqrt(3/2)/(4*Pi^5) - 5/(16*sqrt(6)*Pi^3)
c4 = 0.000957343284806972958968694349196... = 1/(576*Pi^2) - 1/(24*Pi^4) + 93/(80*Pi^6)
a(n) ~ exp(Pi*sqrt(2*n/3))/(4*sqrt(3)*n) * (1 - (sqrt(3/2)/Pi + Pi/(24*sqrt(6)))/sqrt(n) + (1/16 + Pi^2/6912)/n).
a(n) ~ exp(Pi*sqrt(2*n/3) - (sqrt(3/2)/Pi + Pi/(24*sqrt(6)))/sqrt(n) + (1/24 - 3/(4*Pi^2))/n) / (4*sqrt(3)*n).
(End)
a(n) < exp( (2/3)^(1/2) Pi sqrt(n) ) (Ayoub, p. 197).
G.f.: Product_{m>=1} (1+x^m)^A001511(m). - Vladeta Jovovic, Mar 26 2004
a(n) = Sum_{i=0..n-1} P(i, n-i), where P(x, y) is the number of partitions of x into at most y parts and P(0, y)=1. - Jon Perry, Jun 16 2003
G.f.: Product_{i>=1} Product_{j>=0} (1+x^((2i-1)*2^j))^(j+1). - Jon Perry, Jun 06 2004
G.f. e^(Sum_{k>0} (x^k/(1-x^k)/k)). - Franklin T. Adams-Watters, Feb 08 2006
a(n) = A114099(9*n). - Reinhard Zumkeller, Feb 15 2006
Euler transform of all 1's sequence (A000012). Weighout transform of A001511. - Franklin T. Adams-Watters, Mar 15 2006
a(n) = A027187(n) + A027193(n) = A000701(n) + A046682(n). - Reinhard Zumkeller, Apr 22 2006
A026820(a(n),n) = A134737(n) for n > 0. - Reinhard Zumkeller, Nov 07 2007
Convolved with A152537 gives A000079, powers of 2. - Gary W. Adamson, Dec 06 2008
a(n) = A026820(n, n); a(n) = A108949(n) + A045931(n) + A108950(n) = A130780(n) + A171966(n) - A045931(n) = A045931(n) + A171967(n). - Reinhard Zumkeller, Jan 21 2010
a(n) = Tr(n)/(24*n-1) = A183011(n)/A183010(n), n>=1. See the Bruinier-Ono paper in the Links. - Omar E. Pol, Jan 23 2011
From Jerome Malenfant, Feb 14 2011: (Start)
a(n) = determinant of the n X n Toeplitz matrix:
1 -1
1 1 -1
0 1 1 -1
0 0 1 1 -1
-1 0 0 1 1 -1
. . .
d_n d_(n-1) d_(n-2)...1
where d_q = (-1)^(m+1) if q = m(3m-1)/2 = p_m, the m-th generalized pentagonal number (A001318), otherwise d_q = 0. Note that the 1's run along the diagonal and the -1's are on the superdiagonal. The (n-1) row (not written) would end with ... 1 -1. (End)
Empirical: let F*(x) = Sum_{n=0..infinity} p(n)*exp(-Pi*x*(n+1)), then F*(2/5) = 1/sqrt(5) to a precision of 13 digits.
F*(4/5) = 1/2+3/2/sqrt(5)-sqrt(1/2*(1+3/sqrt(5))) to a precision of 28 digits. These are the only values found for a/b when a/b is from F60, Farey fractions up to 60. The number for F*(4/5) is one of the real roots of 25*x^4 - 50*x^3 - 10*x^2 - 10*x + 1. Note here the exponent (n+1) compared to the standard notation with n starting at 0. - Simon Plouffe, Feb 23 2011
The constant (2^(7/8)*GAMMA(3/4))/(exp(Pi/6)*Pi^(1/4)) = 1.0000034873... when expanded in base exp(4*Pi) will give the first 52 terms of a(n), n>0, the precision needed is 300 decimal digits. - Simon Plouffe, Mar 02 2011
a(n) = A035363(2n). - Omar E. Pol, Nov 20 2009
G.f.: A(x)=1+x/(G(0)-x); G(k) = 1 + x - x^(k+1) - x*(1-x^(k+1))/G(k+1); (continued fraction Euler's kind, 1-step ). - Sergei N. Gladkovskii, Jan 25 2012
Convolution of A010815 with A000712. - Gary W. Adamson, Jul 20 2012
G.f.: 1 + x*(1 - G(0))/(1-x) where G(k) = 1 - 1/(1-x^(k+1))/(1-x/(x-1/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 22 2013
G.f.: Q(0) where Q(k) = 1 + x^(4*k+1)/( (x^(2*k+1)-1)^2 - x^(4*k+3)*(x^(2*k+1)-1)^2/( x^(4*k+3) + (x^(2*k+2)-1)^2/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Feb 16 2013
a(n) = 24*spt(n) + 12*N_2(n) - Tr(n) = 24*A092269(n) + 12*A220908(n) - A183011(n), n >= 1. - Omar E. Pol, Feb 17 2013
a(n) = A066186(n)/n, n >= 1. - Omar E. Pol, Aug 16 2013
From Peter Bala, Dec 23 2013: (Start)
a(n-1) = Sum_{parts k in all partitions of n} mu(k), where mu(k) is the arithmetical Möbius function (see A008683).
Let P(2,n) denote the set of partitions of n into parts k >= 2. Then a(n-2) = -Sum_{parts k in all partitions in P(2,n)} mu(k).
n*( a(n) - a(n-1) ) = Sum_{parts k in all partitions in P(2,n)} k (see A138880).
Let P(3,n) denote the set of partitions of n into parts k >= 3. Then
a(n-3) = (1/2)*Sum_{parts k in all partitions in P(3,n)} phi(k), where phi(k) is the Euler totient function (see A000010). Using this result and Mertens's theorem on the average order of the phi function, we can find an approximate 3-term recurrence for the partition function: a(n) ~ a(n-1) + a(n-2) + (Pi^2/(3*n) - 1)*a(n-3). For example, substituting the values a(47) = 124754, a(48) = 147273 and a(49) = 173525 into the recurrence gives the approximation a(50) ~ 204252.48... compared with the true value a(50) = 204226. (End)
a(n) = Sum_{k=1..n+1} (-1)^(n+1-k)*A000203(k)*A002040(n+1-k). - Mircea Merca, Feb 27 2014
a(n) = A240690(n) + A240690(n+1), n >= 1. - Omar E. Pol, Mar 16 2015
From Gary W. Adamson, Jun 22 2015: (Start)
A production matrix for the sequence with offset 1 is M, an infinite n x n matrix of the following form:
a, 1, 0, 0, 0, 0, ...
b, 0, 1, 0, 0, 0, ...
c, 0, 0, 1, 0, 0, ...
d, 0, 0, 0, 1, 0, ...
.
.
... such that (a, b, c, d, ...) is the signed version of A080995 with offset 1: (1,1,0,0,-1,0,-1,...)
and a(n) is the upper left term of M^n.
This operation is equivalent to the g.f. (1 + x + 2x^2 + 3x^3 + 5x^4 + ...) = 1/(1 - x - x^2 + x^5 + x^7 - x^12 - x^15 + x^22 + ...). (End)
G.f.: x^(1/24)/eta(log(x)/(2 Pi i)). - Thomas Baruchel, Jan 09 2016, after Michael Somos (after Richard Dedekind).
a(n) = Sum_{k=-inf..+inf} (-1)^k a(n-k(3k-1)/2) with a(0)=1 and a(negative)=0. The sum can be restricted to the (finite) range from k = (1-sqrt(1-24n))/6 to (1+sqrt(1-24n))/6, since all terms outside this range are zero. - Jos Koot, Jun 01 2016
G.f.: (conjecture) (r(x) * r(x^2) * r(x^4) * r(x^8) * ...) where r(x) is A000009: (1, 1, 1, 2, 2, 3, 4, ...). - Gary W. Adamson, Sep 18 2016; Doron Zeilberger observed today that "This follows immediately from Euler's formula 1/(1-z) = (1+z)*(1+z^2)*(1+z^4)*(1+z^8)*..." Gary W. Adamson, Sep 20 2016
a(n) ~ 2*Pi * BesselI(3/2, sqrt(24*n-1)*Pi/6) / (24*n-1)^(3/4). - Vaclav Kotesovec, Jan 11 2017
G.f.: Product_{k>=1} (1 + x^k)/(1 - x^(2*k)). - Ilya Gutkovskiy, Jan 23 2018
a(n) = p(1, n) where p(k, n) = p(k+1, n) + p(k, n-k) if k < n, 1 if k = n, and 0 if k > n. p(k, n) is the number of partitions of n into parts >= k. - Lorraine Lee, Jan 28 2020
Sum_{n>=1} 1/a(n) = A078506. - Amiram Eldar, Nov 01 2020
Sum_{n>=0} a(n)/2^n = A065446. - Amiram Eldar, Jan 19 2021
From Simon Plouffe, Mar 12 2021: (Start)
Sum_{n>=0} a(n)/exp(Pi*n) = 2^(3/8)*Gamma(3/4)/(Pi^(1/4)*exp(Pi/24)).
Sum_{n>=0} a(n)/exp(2*Pi*n) = 2^(1/2)*Gamma(3/4)/(Pi^(1/4)*exp(Pi/12)).
[corrected by Vaclav Kotesovec, May 12 2023] (End)
[These are the reciprocals of phi(exp(-Pi)) (A259148) and phi(exp(-2*Pi)) (A259149), where phi(q) is the Euler modular function. See B. C. Berndt (RLN, Vol. V, p. 326), and formulas (13) and (14) in I. Mező, 2013. - Peter Luschny, Mar 13 2021]
a(n) = A000009(n) + A035363(n) + A006477(n). - R. J. Mathar, Feb 01 2022
a(n) = A008284(2*n,n) is also the number of partitions of 2n into n parts. - Ryan Brooks, Jun 11 2022
a(n) = A000700(n) + A330644(n). - R. J. Mathar, Jun 15 2022
a(n) ~ exp(Pi*sqrt(2*n/3)) / (4*n*sqrt(3)) * (1 + Sum_{r>=1} w(r)/n^(r/2)), where w(r) = 1/(-4*sqrt(6))^r * Sum_{k=0..(r+1)/2} binomial(r+1,k) * (r+1-k) / (r+1-2*k)! * (Pi/6)^(r-2*k) [Cormac O'Sullivan, 2023, pp. 2-3]. - Vaclav Kotesovec, Mar 15 2023

Extensions

Additional comments from Ola Veshta (olaveshta(AT)my-deja.com), Feb 28 2001
Additional comments from Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 07 2001

A001622 Decimal expansion of golden ratio phi (or tau) = (1 + sqrt(5))/2.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also decimal expansion of the positive root of (x+1)^n - x^(2n). (x+1)^n - x^(2n) = 0 has only two real roots x1 = -(sqrt(5)-1)/2 and x2 = (sqrt(5)+1)/2 for all n > 0. - Cino Hilliard, May 27 2004
The golden ratio phi is the most irrational among irrational numbers; its successive continued fraction convergents F(n+1)/F(n) are the slowest to approximate to its actual value (I. Stewart, in "Nature's Numbers", Basic Books, 1997). - Lekraj Beedassy, Jan 21 2005
Let t=golden ratio. The lesser sqrt(5)-contraction rectangle has shape t-1, and the greater sqrt(5)-contraction rectangle has shape t. For definitions of shape and contraction rectangles, see A188739. - Clark Kimberling, Apr 16 2011
The golden ratio (often denoted by phi or tau) is the shape (i.e., length/width) of the golden rectangle, which has the special property that removal of a square from one end leaves a rectangle of the same shape as the original rectangle. Analogously, removals of certain isosceles triangles characterize side-golden and angle-golden triangles. Repeated removals in these configurations result in infinite partitions of golden rectangles and triangles into squares or isosceles triangles so as to match the continued fraction, [1,1,1,1,1,...] of tau. For the special shape of rectangle which partitions into golden rectangles so as to match the continued fraction [tau, tau, tau, ...], see A188635. For other rectangular shapes which depend on tau, see A189970, A190177, A190179, A180182. For triangular shapes which depend on tau, see A152149 and A188594; for tetrahedral, see A178988. - Clark Kimberling, May 06 2011
Given a pentagon ABCDE, 1/(phi)^2 <= (A*C^2 + C*E^2 + E*B^2 + B*D^2 + D*A^2) / (A*B^2 + B*C^2 + C*D^2 + D*E^2 + E*A^2) <= (phi)^2. - Seiichi Kirikami, Aug 18 2011
If a triangle has sides whose lengths form a geometric progression in the ratio of 1:r:r^2 then the triangle inequality condition requires that r be in the range 1/phi < r < phi. - Frank M Jackson, Oct 12 2011
The graphs of x-y=1 and x*y=1 meet at (tau,1/tau). - Clark Kimberling, Oct 19 2011
Also decimal expansion of the first root of x^sqrt(x+1) = sqrt(x+1)^x. - Michel Lagneau, Dec 02 2011
Also decimal expansion of the root of (1/x)^(1/sqrt(x+1)) = (1/sqrt(x+1))^(1/x). - Michel Lagneau, Apr 17 2012
This is the case n=5 of (Gamma(1/n)/Gamma(3/n))*(Gamma((n-1)/n)/Gamma((n-3)/n)): (1+sqrt(5))/2 = (Gamma(1/5)/Gamma(3/5))*(Gamma(4/5)/Gamma(2/5)). - Bruno Berselli, Dec 14 2012
Also decimal expansion of the only number x>1 such that (x^x)^(x^x) = (x^(x^x))^x = x^((x^x)^x). - Jaroslav Krizek, Feb 01 2014
For n >= 1, round(phi^prime(n)) == 1 (mod prime(n)) and, for n >= 3, round(phi^prime(n)) == 1 (mod 2*prime(n)). - Vladimir Shevelev, Mar 21 2014
The continuous radical sqrt(1+sqrt(1+sqrt(1+...))) tends to phi. - Giovanni Zedda, Jun 22 2019
Equals sqrt(2+sqrt(2-sqrt(2+sqrt(2-...)))). - Diego Rattaggi, Apr 17 2021
Given any complex p such that real(p) > -1, phi is the only real solution of the equation z^p+z^(p+1)=z^(p+2), and the only attractor of the complex mapping z->M(z,p), where M(z,p)=(z^p+z^(p+1))^(1/(p+2)), convergent from any complex plane point. - Stanislav Sykora, Oct 14 2021
The only positive number such that its decimal part, its integral part and the number itself (x-[x], [x] and x) form a geometric progression is phi, with respectively (phi -1, 1, phi) and a ratio = phi. This is the answer to the 4th problem of the 7th Canadian Mathematical Olympiad in 1975 (see IMO link and Doob reference). - Bernard Schott, Dec 08 2021
The golden ratio is the unique number x such that f(n*x)*c(n/x) - f(n/x)*c(n*x) = n for all n >= 1, where f = floor and c = ceiling. - Clark Kimberling, Jan 04 2022
In The Second Scientific American Book Of Mathematical Puzzles and Diversions, Martin Gardner wrote that, by 1910, Mark Barr (1871-1950) gave phi as a symbol for the golden ratio. - Bernard Schott, May 01 2022
Phi is the length of the equal legs of an isosceles triangle with side c = phi^2, and internal angles (A,B) = 36 degrees, C = 108 degrees. - Gary W. Adamson, Jun 20 2022
The positive solution to x^2 - x - 1 = 0. - Michal Paulovic, Jan 16 2023
The minimal polynomial of phi^n, for nonvanishing integer n, is P(n, x) = x^2 - L(n)*x + (-1)^n, with the Lucas numbers L = A000032, extended to negative arguments with L(n) = (-1)^n*L(n). P(0, x) = (x - 1)^2 is not minimal. - Wolfdieter Lang, Feb 20 2025
This is the largest real zero x of (x^4 + x^2 + 1)^2 = 2*(x^8 + x^4 + 1). - Thomas Ordowski, May 14 2025

Examples

			1.6180339887498948482045868343656381177203091798057628621...
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 24, 112, 123, 184, 190, 203.
  • Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993 - Canadian Mathematical Society & Société Mathématique du Canada, Problem 4, 1975, pages 76-77, 1993.
  • Richard A. Dunlap, The Golden Ratio and Fibonacci Numbers, World Scientific, River Edge, NJ, 1997.
  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, Vol. 94, Cambridge University Press, 2003, Section 1.2.
  • Martin Gardner, The Second Scientific American Book Of Mathematical Puzzles and Diversions, "Phi: The Golden Ratio", Chapter 8, Simon & Schuster, NY, 1961.
  • Martin Gardner, Weird Water and Fuzzy Logic: More Notes of a Fringe Watcher, "The Cult of the Golden Ratio", Chapter 9, Prometheus Books, 1996, pages 90-97.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §8.5 The Fibonacci and Related Sequences, p. 287.
  • H. E. Huntley, The Divine Proportion, Dover, NY, 1970.
  • Mario Livio, The Golden Ratio, Broadway Books, NY, 2002. [see the review by G. Markowsky in the links field]
  • Gary B. Meisner, The Golden Ratio: The Divine Beauty of Mathematics, Race Point Publishing (The Quarto Group), 2018. German translation: Der Goldene Schnitt, Librero, 2023.
  • Scott Olsen, The Golden Section, Walker & Co., NY, 2006.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, pages 137-139.
  • 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).
  • Hans Walser, The Golden Section, Math. Assoc. of Amer. Washington DC 2001.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See pp. 36-40.
  • Claude-Jacques Willard, Le nombre d'or, Magnard, Paris, 1987.

Crossrefs

Programs

  • Maple
    Digits:=1000; evalf((1+sqrt(5))/2); # Wesley Ivan Hurt, Nov 01 2013
  • Mathematica
    RealDigits[(1 + Sqrt[5])/2, 10, 130] (* Stefan Steinerberger, Apr 02 2006 *)
    RealDigits[ Exp[ ArcSinh[1/2]], 10, 111][[1]] (* Robert G. Wilson v, Mar 01 2008 *)
    RealDigits[GoldenRatio,10,120][[1]] (* Harvey P. Dale, Oct 28 2015 *)
  • PARI
    default(realprecision, 20080); x=(1+sqrt(5))/2; for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b001622.txt", n, " ", d));  \\ Harry J. Smith, Apr 19 2009
    
  • PARI
    /* Digit-by-digit method: write it as 0.5+sqrt(1.25) and start at hundredths digit */
    r=11; x=400; print(1); print(6);
    for(dig=1, 110, {d=0; while((20*r+d)*d <= x, d++);
    d--; /* while loop overshoots correct digit */
    print(d); x=100*(x-(20*r+d)*d); r=10*r+d})
    \\ Michael B. Porter, Oct 24 2009
    
  • PARI
    a(n) = floor(10^(n-1)*(quadgen(5))%10);
    alist(len) = digits(floor(quadgen(5)*10^(len-1))); \\ Chittaranjan Pardeshi, Jun 22 2022
    
  • Python
    from sympy import S
    def alst(n): # truncate extra last digit to avoid rounding
      return list(map(int, str(S.GoldenRatio.n(n+1)).replace(".", "")))[:-1]
    print(alst(105)) # Michael S. Branicky, Jan 06 2021

Formula

Equals Sum_{n>=2} 1/A064170(n) = 1/1 + 1/2 + 1/(2*5) + 1/(5*13) + 1/(13*34) + ... - Gary W. Adamson, Dec 15 2007
Equals Hypergeometric2F1([1/5, 4/5], [1/2], 3/4) = 2*cos((3/5)*arcsin(sqrt(3/4))). - Artur Jasinski, Oct 26 2008
From Hieronymus Fischer, Jan 02 2009: (Start)
The fractional part of phi^n equals phi^(-n), if n is odd. For even n, the fractional part of phi^n is equal to 1-phi^(-n).
General formula: Provided x>1 satisfies x-x^(-1)=floor(x), where x=phi for this sequence, then:
for odd n: x^n - x^(-n) = floor(x^n), hence fract(x^n) = x^(-n),
for even n: x^n + x^(-n) = ceiling(x^n), hence fract(x^n) = 1 - x^(-n),
for all n>0: x^n + (-x)^(-n) = round(x^n).
x=phi is the minimal solution to x - x^(-1) = floor(x) (where floor(x)=1 in this case).
Other examples of constants x satisfying the relation x - x^(-1) = floor(x) include A014176 (the silver ratio: where floor(x)=2) and A098316 (the "bronze" ratio: where floor(x)=3). (End)
Equals 2*cos(Pi/5) = e^(i*Pi/5) + e^(-i*Pi/5). - Eric Desbiaux, Mar 19 2010
The solutions to x-x^(-1)=floor(x) are determined by x=(1/2)*(m+sqrt(m^2+4)), m>=1; x=phi for m=1. In terms of continued fractions the solutions can be described by x=[m;m,m,m,...], where m=1 for x=phi, and m=2 for the silver ratio A014176, and m=3 for the bronze ratio A098316. - Hieronymus Fischer, Oct 20 2010
Sum_{n>=1} x^n/n^2 = Pi^2/10 - (log(2)*sin(Pi/10))^2 where x = 2*sin(Pi/10) = this constant here. [Jolley, eq 360d]
phi = 1 + Sum_{k>=1} (-1)^(k-1)/(F(k)*F(k+1)), where F(n) is the n-th Fibonacci number (A000045). Proof. By Catalan's identity, F^2(n) - F(n-1)*F(n+1) = (-1)^(n-1). Therefore,(-1)^(n-1)/(F(n)*F(n+1)) = F(n)/F(n+1) - F(n-1)/F(n). Thus Sum_{k=1..n} (-1)^(k-1)/(F(k)*F(k+1)) = F(n)/F(n+1). If n goes to infinity, this tends to 1/phi = phi - 1. - Vladimir Shevelev, Feb 22 2013
phi^n = (A000032(n) + A000045(n)*sqrt(5)) / 2. - Thomas Ordowski, Jun 09 2013
Let P(q) = Product_{k>=1} (1 + q^(2*k-1)) (the g.f. of A000700), then A001622 = exp(Pi/6) * P(exp(-5*Pi)) / P(exp(-Pi)). - Stephen Beathard, Oct 06 2013
phi = i^(2/5) + i^(-2/5) = ((i^(4/5))+1) / (i^(2/5)) = 2*(i^(2/5) - (sin(Pi/5))i) = 2*(i^(-2/5) + (sin(Pi/5))i). - Jaroslav Krizek, Feb 03 2014
phi = sqrt(2/(3 - sqrt(5))) = sqrt(2)/A094883. This follows from the fact that ((1 + sqrt(5))^2)*(3 - sqrt(5)) = 8, so that ((1 + sqrt(5))/2)^2 = 2/(3 - sqrt(5)). - Geoffrey Caveney, Apr 19 2014
exp(arcsinh(cos(Pi/2-log(phi)*i))) = exp(arcsinh(sin(log(phi)*i))) = (sqrt(3) + i) / 2. - Geoffrey Caveney, Apr 23 2014
exp(arcsinh(cos(Pi/3))) = phi. - Geoffrey Caveney, Apr 23 2014
cos(Pi/3) + sqrt(1 + cos(Pi/3)^2). - Geoffrey Caveney, Apr 23 2014
2*phi = z^0 + z^1 - z^2 - z^3 + z^4, where z = exp(2*Pi*i/5). See the Wikipedia Kronecker-Weber theorem link. - Jonathan Sondow, Apr 24 2014
phi = 1/2 + sqrt(1 + (1/2)^2). - Geoffrey Caveney, Apr 25 2014
Phi is the limiting value of the iteration of x -> sqrt(1+x) on initial value a >= -1. - Chayim Lowen, Aug 30 2015
From Isaac Saffold, Feb 28 2018: (Start)
1 = Sum_{k=0..n} binomial(n, k) / phi^(n+k) for all nonnegative integers n.
1 = Sum_{n>=1} 1 / phi^(2n-1).
1 = Sum_{n>=2} 1 / phi^n.
phi = Sum_{n>=1} 1/phi^n. (End)
From Christian Katzmann, Mar 19 2018: (Start)
phi = Sum_{n>=0} (15*(2*n)! + 8*n!^2)/(2*n!^2*3^(2*n+2)).
phi = 1/2 + Sum_{n>=0} 5*(2*n)!/(2*n!^2*3^(2*n+1)). (End)
phi = Product_{k>=1} (1 + 2/(-1 + 2^k*(sqrt(4+(1-2/2^k)^2) + sqrt(4+(1-1/2^k)^2)))). - Gleb Koloskov, Jul 14 2021
Equals Product_{k>=1} (Fibonacci(3*k)^2 + (-1)^(k+1))/(Fibonacci(3*k)^2 + (-1)^k) (Melham and Shannon, 1995). - Amiram Eldar, Jan 15 2022
From Michal Paulovic, Jan 16 2023: (Start)
Equals the real part of 2 * e^(i * Pi / 5).
Equals 2 * sin(3 * Pi / 10) = 2*A019863.
Equals -2 * sin(37 * Pi / 10).
Equals 1 + 1 / (1 + 1 / (1 + 1 / (1 + 1 / (1 + 1 / ...)))).
Equals (2 + 3 * (2 + 3 * (2 + 3 * ...)^(1/4))^(1/4))^(1/4).
Equals (1 + 2 * (1 + 2 * (1 + 2 * ...)^(1/3))^(1/3))^(1/3).
Equals (1 + phi + (1 + phi + (1 + phi + ...)^(1/3))^(1/3))^(1/3).
Equals 13/8 + Sum_{k=0..oo} (-1)^(k+1)*(2*k+1)!/((k+2)!*k!*4^(2*k+3)).
(End)
phi^n = phi * A000045(n) + A000045(n-1). - Gary W. Adamson, Sep 09 2023
The previous formula holds for integer n, with F(-n) = (-1)^(n+1)*F(n), for n >= 0, with F(n) = A000045(n), for n >= 0. phi^n are integers in the quadratic number field Q(sqrt(5)). - Wolfdieter Lang, Sep 16 2023
Equals Product_{k>=0} ((5*k + 2)*(5*k + 3))/((5*k + 1)*(5*k + 4)). - Antonio Graciá Llorente, Feb 24 2024
From Antonio Graciá Llorente, Apr 21 2024: (Start)
Equals Product_{k>=1} phi^(-2^k) + 1, with phi = A001622.
Equals Product_{k>=0} ((5^(k+1) + 1)*(5^(k-1/2) + 1))/((5^k + 1)*(5^(k+1/2) + 1)).
Equals Product_{k>=1} 1 - (4*(-1)^k)/(10*k - 5 + (-1)^k) = Product_{k>=1} A047221(k)/A047209(k).
Equals Product_{k>=0} ((5*k + 7)*(5*k + 1 + (-1)^k))/((5*k + 1)*(5*k + 7 + (-1)^k)).
Equals Product_{k>=0} ((10*k + 3)*(10*k + 5)*(10*k + 8)^2)/((10*k + 2)*(10*k + 4)*(10*k + 9)^2).
Equals Product_{k>=5} 1 + 1/(Fibonacci(k) - (-1)^k).
Equals Product_{k>=2} 1 + 1/Fibonacci(2*k).
Equals Product_{k>=2} (Lucas(k)^2 + (-1)^k)/(Lucas(k)^2 - 4*(-1)^k). (End)

Extensions

Additional links contributed by Lekraj Beedassy, Dec 23 2003
More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Oct 24 2004
More terms from Stefan Steinerberger, Apr 02 2006
Broken URL to Project Gutenberg replaced by Georg Fischer, Jan 03 2009
Edited by M. F. Hasler, Feb 24 2014

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

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

A000122 Expansion of Jacobi theta function theta_3(x) = Sum_{m =-oo..oo} x^(m^2) (number of integer solutions to k^2 = n).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (the present sequence), psi(q) (A010054), chi(q) (A000700).
Theta series of the one-dimensional lattice Z.
Also, essentially the same as the theta series of the one-dimensional lattices A_1, A*_1, D_1, D*_1.
Number of ways of writing n as a square.
Closely related: theta_4(x) = Sum_{m = -oo..oo} (-x)^(m^2). See A002448.
Number 6 of the 14 primitive eta-products which are holomorphic modular forms of weight 1/2 listed by D. Zagier on page 30 of "The 1-2-3 of Modular Forms". - Michael Somos, May 04 2016

Examples

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

References

  • Tom M. Apostol, Modular Functions and Dirichlet Series in Number Theory, Second edition, Springer, 1990, Exercise 1, p. 91.
  • Richard Bellman, A Brief Introduction to Theta Functions, Dover, 2013.
  • J. M. Borwein and P. B. Borwein, Pi and the AGM, Wiley, 1987, p. 64.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 104, [5n].
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 93, Eq. (34.1); p. 78, Eq. (32.22).
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 133.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Sixth Edition, Clarendon Press, Oxford, 2009, Theorem 352, p. 372.
  • J. Tannery and J. Molk, Eléments de la Théorie des Fonctions Elliptiques, Vol. 2, Gauthier-Villars, Paris, 1902; Chelsea, NY, 1972, see p. 27.
  • E. T. Whittaker and G. N. Watson, A Course of Modern Analysis, Cambridge Univ. Press, 4th ed., 1963, p. 464.

Crossrefs

1st column of A286815. - Seiichi Manyama, May 27 2017
Row d=1 of A122141.
Cf. A002448 (theta_4). Partial sums give A001650.
Cf. A000007, A004015, A004016, A008444, A008445, A008446, A008447, A008448, A008449 (Theta series of lattices A_0, A_3, A_2, A_4, ...).

Programs

  • Julia
    using Nemo
    function JacobiTheta3(len, r)
        R, x = PolynomialRing(ZZ, "x")
        e = theta_qexp(r, len, x)
        [fmpz(coeff(e, j)) for j in 0:len - 1] end
    A000122List(len) = JacobiTheta3(len, 1)
    A000122List(105) |> println # Peter Luschny, Mar 12 2018
    
  • Magma
    Basis( ModularForms( Gamma0(4), 1/2), 100) [1]; /* Michael Somos, Jun 10 2014 */
    
  • Magma
    L := Lattice("A",1); A := ThetaSeries(L, 20); A; /* Michael Somos, Nov 13 2014 */
    
  • Maple
    add(x^(m^2),m=-10..10): seq(coeff(%,x,n), n=0..100);
    # alternative
    A000122 := proc(n)
        if n = 0 then
            1;
        elif issqr(n) then
            2;
        else
            0 ;
        end if;
    end proc:
    seq(A000122(n),n=0..100) ; # R. J. Mathar, Feb 22 2021
  • Mathematica
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q], {q, 0, n}]; (* Michael Somos, Jul 11 2011 *)
    CoefficientList[ Sum[ x^(m^2), {m, -(n=10), n} ], x ]
    SquaresR[1, Range[0, 104]] (* Robert G. Wilson v, Jul 16 2014 *)
    QP = QPochhammer; s = QP[q^2]^5/(QP[q]*QP[q^4])^2 + O[q]^105; CoefficientList[s, q] (* Jean-François Alcover, Nov 24 2015 *)
    (4 QPochhammer[q^2]/QPochhammer[-1,-q]^2 + O[q]^101)[[3]] (* Vladimir Reshetnikov, Sep 16 2016 *)
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^5 / (eta(x + A) * eta(x^4 + A))^2, n))}; /* Michael Somos, Mar 14 2011 */
    
  • PARI
    {a(n) = issquare(n) * 2 -(n==0)}; /* Michael Somos, Jun 17 1999 */
    
  • Python
    from sympy.ntheory.primetest import is_square
    def A000122(n): return is_square(n)<<1 if n else 1 # Chai Wah Wu, May 17 2023
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1])
    Q.representation_number_list(105) # Peter Luschny, Jun 20 2014
    

Formula

Expansion of eta(q^2)^5 / (eta(q)*eta(q^4))^2 in powers of q.
Euler transform of period 4 sequence [2, -3, 2, -1, ...].
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = u^2 - v^2 + 2 * w * (w - u). - Michael Somos, Jul 20 2004
G.f. A(x) satisfies 0 = f(A(x), A(x^3), A(x^9)) where f(u, v, w) = w^4 - v^4 + w * (u - w)^3. - Michael Somos, May 11 2019
G.f.: Sum_{m=-oo..oo} x^(m^2);
a(0) = 1; for n > 0, a(n) = 0 unless n is a square when a(n) = 2.
G.f.: Product_{k>0} (1 - x^(2*k))*(1 + x^(2*k-1))^2.
G.f.: s(2)^5/(s(1)^2*s(4)^2), where s(k) := subs(q=q^k, eta(q)), where eta(q) is Dedekind's function, cf. A010815. [Fine]
The Jacobi triple product identity states that for |x| < 1, z != 0, Product_{n>0} {(1-x^(2n))(1+x^(2n-1)z)(1+x^(2n-1)/z)} = Sum_{n=-inf..inf} x^(n^2)*z^n. Set z=1 to get theta_3(x).
For n > 0, a(n) = 2*(floor(sqrt(n))-floor(sqrt(n-1))). - Mikael Aaltonen, Jan 17 2015
G.f. is a period 1 Fourier series which satisfies f(-1/(4 t)) = 2^(1/2) (t/i)^(1/2) f(t) where q = exp(2 Pi i t). - Michael Somos, May 05 2016
a(n) = A000132(n)(mod 4). - John M. Campbell, Jul 07 2016
a(n) = (2/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017
a(n) = 2 * A010052(n) if n>0. a(3*n + 1) = 2 * A089801(n). a(3*n + 2) = 0. a(4*n) = a(n). a(4*n + 2) = a(4*n + 3) = 0. a(8*n + 1) = 2 * A010054(n). - Michael Somos, May 11 2019
Dirichlet g.f.: 2*zeta(2s). - Francois Oger, Oct 26 2019 [Corrected by Sean A. Irvine, Nov 26 2024]
G.f. appears to equal exp( 2*Sum_{n >= 0} x^(2*n+1)/((2*n+1)*(1 + x^(2*n+1))) ). - Peter Bala, Dec 23 2021
From Peter Bala, Sep 27 2023: (Start)
G.f. A(x) satisfies A(x)*A(-x) = A(-x^2)^2.
A(x) = Sum_{n >= 1} x^(n-1)*Product_{k >= n} 1 - (-x)^k.
A(x)^2 = 1 + 4*Sum_{n >= 1} (-1)^(n+1)*x^(2*n-1)/(1 - x^(2*n-1)), which gives the number of representations of an integer as a sum of two squares. See, for example, Fine, 26.63.
A(x) = 1 + 2*Sum_{n >= 1} x^(n*(n+1)/2) * ( Product_{k = 1..n-1} 1 + x^k ) /( Product_{k = 1..n} 1 + x^(2*k) ). See Fine, equation 14.43. (End)
Showing 1-10 of 1638 results. Next