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

A133639 Mobius transform of b(n) where b(8n + 1) = A080995(n).

Original entry on oeis.org

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

Views

Author

Michael Somos, Sep 14 2007

Keywords

Examples

			G.f. = x - x^2 - x^3 - x^5 + x^6 - x^7 + x^10 - x^11 - x^13 + x^14 + x^15 + ...
		

Crossrefs

Cf. A080995.

Programs

  • Mathematica
    a[ n_] := If[ n < 1, 0, Times @@ (Which[# == 1, 1, # < 5, -Boole[#2 == 1], True, (-1)^#2] & @@@ FactorInteger @ n)]; (* Michael Somos, Oct 31 2015 *)
  • PARI
    {a(n) = my(A, p, e); if( n<1, 0, A = factor(n); prod(k = 1, matsize(A)[1], [p, e] = A[k, ]; if(p < 5, -(e==1), (-1)^e )))};
    
  • Scheme
    ;; With memoization-macro definec:
    (definec (A133639 n) (cond ((= 1 n) n) ((zero? (modulo n 4)) 0) ((zero? (modulo n 9)) 0) ((even? n) (- (A133639 (/ n 2)))) ((zero? (modulo n 3)) (- (A133639 (/ n 3)))) (else (- (A133639 (A032742 n)))))) ;; (For the code of A032742, see under that entry) Antti Karttunen, Sep 23 2017

Formula

a(n) is multiplicative with a(2^e) = a(3^e) = -1 if e=1, 0 if e>1, a(p^e) = (-1)^e if p > 3.
a(4*n) = a(9*n) = 0.
Dirichlet g.f.: (zeta(2*s)/zeta(s)) * (1 - 2^(-2*s)) * (1 - 3^(-2*s)). - Amiram Eldar, Oct 28 2023

A175010 Triangle generated from INVERT transforms of variants of A080995.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 5, 1, 1, 1, 1, 1, 4, 6, 1, 1, 1, 1, 1, 2, 6, 9, 1, 1, 1, 1, 1, 1, 4, 8, 12, 1, 1, 1, 1, 1, 1, 2, 6, 12, 16, 1, 1, 1, 1, 1, 1, 1, 4, 8, 19, 18, 1, 1, 1, 1, 1, 1, 1, 2, 6, 11, 28, 23
Offset: 1

Views

Author

Gary W. Adamson, Apr 03 2010

Keywords

Comments

Row sums = A000041 starting with offset 1: (1, 1, 2, 3, 5, 7, 11, 15, ...).
The INVERTi transform of A000041 starting with offset 1 follows from the definition of the INVERT transform, given 1/p(x) = A010815.

Examples

			First few rows of the array:
1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101,
1, 1, 2, 3, 4,  6,  9, 13, 18, 26, 38, 54,  76,
1, 1, 1, 2, 3,  4,  5,  7, 10, 14, 19, 26,  35,
1, 1, 1, 1, 2,  3,  4,  5,  6,  8, 11, 15,  20,
1, 1, 1, 1, 1,  2,  3,  4,  5,  6,  7,  9,  12,
1, 1, 1, 1, 1,  1,  2,  3,  4,  5,  6,  7,   8,
...
Taking finite differences from the bottom starting with the top "1", we obtain rows of the triangle:
1;
1, 1;
1, 1, 1;
1, 1, 1, 2;
1, 1, 1, 1, 3;
1, 1, 1, 1, 2, 5;
1, 1, 1, 1, 1, 4, 6;
1, 1, 1, 1, 1, 2, 6, 9;
1, 1, 1, 1, 1, 1, 4, 8, 12;
1, 1, 1, 1, 1, 1, 2, 6, 12, 16;
1, 1, 1, 1, 1, 1, 1, 4,  8, 19, 18;
1, 1, 1, 1, 1, 1, 1, 2,  6, 11, 28, 23;
1, 1, 1, 1, 1, 1, 1, 1,  4,  8, 15, 41, 25;
1, 1, 1, 1, 1, 1, 1, 1,  2,  6, 10, 22, 61, 26;
...
Example: Row 2 = INVERT transform of Q(x^2), (i.e., Q(x) interleaved with one zero between terms).
		

Crossrefs

Formula

Given the INVERTi transform of the partition numbers starting with offset 1 = a signed variant of A080995 such that Q = (1, 1, 0, 0, -1, 0, -1, 0, 0, 0, 0, 1, ...).
Construct an array in which k-th row (k=1,2,3,...) = the INVERT transform of Q(x^k), i.e., where polcoeff Q(x) is interleaved with 0,1,2,3,... zeros.
Take finite differences of the array terms starting with the last "1" going from the bottom to top, becoming rows of triangle A175010.

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

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

Original entry on oeis.org

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

Views

Author

Keywords

Comments

When convolved with the partition numbers A000041 gives 1, 0, 0, 0, 0, ...
Also, number of different partitions of n into parts of -1 different kinds (based upon formal analogy). - Michele Dondi (blazar(AT)lcm.mi.infn.it), Jun 29 2004
The comment that "when convolved with the partition numbers gives [1, 0, 0, 0, ...]" is equivalent to row sums of triangle A145975 = [1, 0, 0, 0, ...]; where A145975 is a partition number convolution triangle. - Gary W. Adamson, Oct 25 2008
When convolved with n-th partial sums of A000041 = the binomial sequence starting (1, n, ...). Example: A010815 convolved with A014160 (partial sum operation applied thrice to the partition numbers) = (1, 3, 6, 10, ...). - Gary W. Adamson, Nov 11 2008
(A000012^(-n) * A000041) convolved with A010815 = n-th row of the inverse of Pascal's triangle, (as a vector, followed by zeros); where A000012^(-1) = the pairwise difference operator. Example: (A000012^(-4) * A000041) convolved with A010815 = (1, -4, 6, -4, 1, 0, 0, 0, ...). - Gary W. Adamson, Nov 11 2008
Also sum of [product of (1-2/(hook lengths)^2)] over all partitions of n. - Wouter Meeussen, Sep 16 2010
Cayley (1895) begins article 387 with "Write for shortness sqrt(2k'K / pi) / [1-q^{2m-1}]^2 = G, ..." which is a convoluted way of writing G = [1-q^{2m}] = (1-q^2)(1-q^4)... - Michael Somos, Aug 01 2011
This is an example of the quintuple product identity in the form f(a*b^4, a^2/b) - (a/b) * f(a^4*b, b^2/a) = f(-a*b, -a^2*b^2) * f(-a/b, -b^2) / f(a, b) where a = x^3, b = x. - Michael Somos, Jan 21 2012
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Number 1 of the 14 primitive eta-products which are holomorphic modular forms of weight 1/2 listed by D. Zagier on page 30 of "The 1-2-3 of Modular Forms". - Michael Somos, May 04 2016

Examples

			G.f. = 1 - x - x^2 + x^5 + x^7 - x^12 - x^15 + x^22 + x^26 - x^35 - x^40 + ...
G.f. = q - q^25 - q^49 + q^121 + q^169 - q^289 - q^361 + q^529 + q^625 + ...
From _Seiichi Manyama_, Mar 04 2017: (Start)
G.f.
= 1 + (-x - 3*x^2/2 - 4*x^3/3 -  7*x^4/4  -  6*x^5/5 - ...)
     + 1/2 * (x^2   + 3*x^3   + 59*x^4/12 + 15*x^5/2 + ...)
              + 1/6 * (-x^3   -  9*x^4/2  - 43*x^5/4 - ...)
                         + 1/24 * (x^4    +  6*x^5   + ...)
                                   + 1/120 * (-x^5   - ...)
                                             + ...
= 1 - x - x^2 + x^5 + .... (End)
		

References

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

Crossrefs

Programs

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

Formula

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

Extensions

Additional comments from Michael Somos, Jun 05 2002

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

Original entry on oeis.org

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

Views

Author

Michael Somos, Jul 24 2006

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
This is an example of the quintuple product identity in the form f(a*b^4, a^2/b) - (a/b) * f(a^4*b, b^2/a) = f(-a*b, -a^2*b^2) * f(-a/b, -b^2) / f(a, b) where a = -x^3, b = -x. - Michael Somos, Jul 11 2012
Number 5 of the 14 primitive eta-products which are holomorphic modular forms of weight 1/2 listed by D. Zagier on page 30 of "The 1-2-3 of Modular Forms". - Michael Somos, May 04 2016

Examples

			G.f. = 1 + x - x^2 - x^5 - x^7 - x^12 + x^15 + x^22 + x^26 + x^35 + ...
G.f. = q + q^25 - q^49 - q^121 - q^169 - q^289 + q^361 + q^529 + ...
		

Crossrefs

Programs

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

Formula

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

A001318 Generalized pentagonal numbers: m*(3*m - 1)/2, m = 0, +-1, +-2, +-3, ....

Original entry on oeis.org

0, 1, 2, 5, 7, 12, 15, 22, 26, 35, 40, 51, 57, 70, 77, 92, 100, 117, 126, 145, 155, 176, 187, 210, 222, 247, 260, 287, 301, 330, 345, 376, 392, 425, 442, 477, 495, 532, 551, 590, 610, 651, 672, 715, 737, 782, 805, 852, 876, 925, 950, 1001, 1027, 1080, 1107, 1162, 1190, 1247, 1276, 1335
Offset: 0

Views

Author

Keywords

Comments

Partial sums of A026741. - Jud McCranie; corrected by Omar E. Pol, Jul 05 2012
From R. K. Guy, Dec 28 2005: (Start)
"Conway's relation twixt the triangular and pentagonal numbers: Divide the triangular numbers by 3 (when you can exactly):
0 1 3 6 10 15 21 28 36 45 55 66 78 91 105 120 136 153 ...
0 - 1 2 .- .5 .7 .- 12 15 .- 22 26 .- .35 .40 .- ..51 ...
.....-.-.....+..+.....-..-.....+..+......-...-.......+....
"and you get the pentagonal numbers in pairs, one of positive rank and the other negative.
"Append signs according as the pair have the same (+) or opposite (-) parity.
"Then Euler's pentagonal number theorem is easy to remember:
"p(n-0) - p(n-1) - p(n-2) + p(n-5) + p(n-7) - p(n-12) - p(n-15) ++-- = 0^n
where p(n) is the partition function, the left side terminates before the argument becomes negative and 0^n = 1 if n = 0 and = 0 if n > 0.
"E.g. p(0) = 1, p(7) = p(7-1) + p(7-2) - p(7-5) - p(7-7) + 0^7 = 11 + 7 - 2 - 1 + 0 = 15."
(End)
The sequence may be used in order to compute sigma(n), as described in Euler's article. - Thomas Baruchel, Nov 19 2003
Number of levels in the partitions of n + 1 with parts in {1,2}.
a(n) is the number of 3 X 3 matrices (symmetrical about each diagonal) M = {{a, b, c}, {b, d, b}, {c, b, a}} such that a + b + c = b + d + b = n + 2, a,b,c,d natural numbers; example: a(3) = 5 because (a,b,c,d) = (2,2,1,1), (1,2,2,1), (1,1,3,3), (3,1,1,3), (2,1,2,3). - Philippe Deléham, Apr 11 2007
Also numbers a(n) such that 24*a(n) + 1 = (6*m - 1)^2 are odd squares: 1, 25, 49, 121, 169, 289, 361, ..., m = 0, +-1, +-2, ... . - Zak Seidov, Mar 08 2008
From Matthew Vandermast, Oct 28 2008: (Start)
Numbers n for which A000326(n) is a member of A000332. Cf. A145920.
This sequence contains all members of A000332 and all nonnegative members of A145919. For values of n such that n*(3*n - 1)/2 belongs to A000332, see A145919. (End)
Starting with offset 1 = row sums of triangle A168258. - Gary W. Adamson, Nov 21 2009
Starting with offset 1 = Triangle A101688 * [1, 2, 3, ...]. - Gary W. Adamson, Nov 27 2009
Starting with offset 1 can be considered the first in an infinite set generated from A026741. Refer to the array in A175005. - Gary W. Adamson, Apr 03 2010
Vertex number of a square spiral whose edges have length A026741. The two axes of the spiral forming an "X" are A000326 and A005449. The four semi-axes forming an "X" are A049452, A049453, A033570 and the numbers >= 2 of A033568. - Omar E. Pol, Sep 08 2011
A general formula for the generalized k-gonal numbers is given by n*((k - 2)*n - k + 4)/2, n=0, +-1, +-2, ..., k >= 5. - Omar E. Pol, Sep 15 2011
a(n) is the number of 3-tuples (w,x,y) having all terms in {0,...,n} and 2*w = 2*x + y. - Clark Kimberling, Jun 04 2012
Generalized k-gonal numbers are second k-gonal numbers and positive terms of k-gonal numbers interleaved, k >= 5. - Omar E. Pol, Aug 04 2012
a(n) is the sum of the largest parts of the partitions of n+1 into exactly 2 parts. - Wesley Ivan Hurt, Jan 26 2013
Conway's relation mentioned by R. K. Guy is a relation between triangular numbers and generalized pentagonal numbers, two sequences from different families, but as triangular numbers are also generalized hexagonal numbers in this case we have a relation between two sequences from the same family. - Omar E. Pol, Feb 01 2013
Start with the sequence of all 0's. Add n to each value of a(n) and the next n - 1 terms. The result is the generalized pentagonal numbers. - Wesley Ivan Hurt, Nov 03 2014
(6k + 1) | a(4k). (3k + 1) | a(4k+1). (3k + 2) | a(4k+2). (6k + 5) | a(4k+3). - Jon Perry, Nov 04 2014
Enge, Hart and Johansson proved: "Every generalised pentagonal number c >= 5 is the sum of a smaller one and twice a smaller one, that is, there are generalised pentagonal numbers a, b < c such that c = 2a + b." (see link theorem 5). - Peter Luschny, Aug 26 2016
The Enge, et al. result for c >= 5 also holds for c >= 2 if 0 is included as a generalized pentagonal number. That is, 2 = 2*1 + 0. - Michael Somos, Jun 02 2018
Suggestion for title, where n actually matches the list and b-file: "Generalized pentagonal numbers: k(n)*(3*k(n) - 1)/2, where k(n) = A001057(n) = [0, 1, -1, 2, -2, 3, -3, ...], n >= 0" - Daniel Forgues, Jun 09 2018 & Jun 12 2018
Generalized k-gonal numbers are the partial sums of the sequence formed by the multiples of (k - 4) and the odd numbers (A005408) interleaved, with k >= 5. - Omar E. Pol, Jul 25 2018
The last digits form a symmetric cycle of length 40 [0, 1, 2, 5, ..., 5, 2, 1, 0], i.e., a(n) == a(n + 40) (mod 10) and a(n) == a(40*k - n - 1) (mod 10), 40*k > n. - Alejandro J. Becerra Jr., Aug 14 2018
Only 2, 5, and 7 are prime. All terms are of the form k*(k+1)/6, where 3 | k or 3 | k+1. For k > 6, the value divisible by 3 must have another factor d > 2, which will remain after the division by 6. - Eric Snyder, Jun 03 2022
8*a(n) is the product of two even numbers one of which is n + n mod 2. - Peter Luschny, Jul 15 2022
a(n) is the dot product of [1, 2, 3, ..., n] and repeat[1, 1/2]. a(5) = 12 = [1, 2, 3, 4, 5] dot [1, 1/2, 1, 1/2, 1] = [1 + 1 + 3 + 2 + 5]. - Gary W. Adamson, Dec 10 2022
Every nonnegative number is the sum of four terms of this sequence [S. Realis]. - N. J. A. Sloane, May 07 2023
From Peter Bala, Jan 06 2025: (Start)
The sequence terms are the exponents in the expansions of the following infinite products:
1) Product_{n >= 1} (1 - s(n)*q^n) = 1 + q + q^2 + q^5 + q^7 + q^12 + q^15 + ..., where s(n) = (-1)^(1 + mod(n+1,3)).
2) Product_{n >= 1} (1 - q^(2*n))*(1 - q^(3*n))^2/((1 - q^n)*(1 - q^(6*n))) = 1 + q + q^2 + q^5 + q^7 + q^12 + q^15 + ....
3) Product_{n >= 1} (1 - q^n)*(1 - q^(4*n))*(1 - q^(6*n))^5/((1 - q^(2*n))*(1 - q^(3*n))*(1 - q^(12*n)))^2 = 1 - q + q^2 - q^5 - q^7 + q^12 - q^15 + q^22 + q^26 - q^35 + ....
4) Product_{n >= 1} (1 - q^(2*n))^13/((1 - (-1)^n*q^n)*(1 - q^(4*n)))^5 = 1 - 5*q + 7*q^2 - 11*q^5 + 13*q^7 - 17*q^12 + 19*q^15 - + .... See Oliver, Theorem 1.1. (End)

Examples

			G.f. = x + 2*x^2 + 5*x^3 + 7*x^4 + 12*x^5 + 15*x^6 + 22*x^7 + 26*x^8 + 35*x^9 + ...
		

References

  • Enoch Haga, A strange sequence and a brilliant discovery, chapter 5 of Exploring prime numbers on your PC and the Internet, first revised ed., 2007 (and earlier ed.), pp. 53-70.
  • Ross Honsberger, Ingenuity in Mathematics, Random House, 1970, p. 117.
  • Donald E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, (to appear), section 7.2.1.4, equation (18).
  • Ivan Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers, 2nd ed., Wiley, NY, 1966, p. 231.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A080995 (characteristic function), A026741 (first differences), A034828 (partial sums), A165211 (mod 2).
Cf. A000326 (pentagonal numbers), A005449 (second pentagonal numbers), A000217 (triangular numbers).
Indices of nonzero terms of A010815, i.e., the (zero-based) indices of 1-bits of the infinite binary word to which the terms of A068052 converge.
Union of A036498 and A036499.
Sequences of generalized k-gonal numbers: this sequence (k=5), A000217 (k=6), A085787 (k=7), A001082 (k=8), A118277 (k=9), A074377 (k=10), A195160 (k=11), A195162 (k=12), A195313 (k=13), A195818 (k=14), A277082 (k=15), A274978 (k=16), A303305 (k=17), A274979 (k=18), A303813 (k=19), A218864 (k=20), A303298 (k=21), A303299 (k=22), A303303 (k=23), A303814 (k=24), A303304 (k=25), A316724 (k=26), A316725 (k=27), A303812 (k=28), A303815 (k=29), A316729 (k=30).
Column 1 of A195152.
Squares in APs: A221671, A221672.
Quadrisection: A049453(k), A033570(k), A033568(k+1), A049452(k+1), k >= 0.
Cf. A002620.

Programs

  • GAP
    a:=[0,1,2,5];; for n in [5..60] do a[n]:=2*a[n-2]-a[n-4]+3; od; a; # Muniru A Asiru, Aug 16 2018
    
  • Haskell
    a001318 n = a001318_list !! n
    a001318_list = scanl1 (+) a026741_list -- Reinhard Zumkeller, Nov 15 2015
    
  • Magma
    [(6*n^2 + 6*n + 1 - (2*n + 1)*(-1)^n)/16 : n in [0..50]]; // Wesley Ivan Hurt, Nov 03 2014
    
  • Magma
    [(3*n^2 + 2*n + (n mod 2) * (2*n + 1)) div 8: n in [0..70]]; // Vincenzo Librandi, Nov 04 2014
    
  • Maple
    A001318 := -(1+z+z**2)/(z+1)**2/(z-1)**3; # Simon Plouffe in his 1992 dissertation; gives sequence without initial zero
    A001318 := proc(n) (6*n^2+6*n+1)/16-(2*n+1)*(-1)^n/16 ; end proc: # R. J. Mathar, Mar 27 2011
  • Mathematica
    Table[n*(n+1)/6, {n, Select[Range[0, 100], Mod[#, 3] != 1 &]}]
    Select[Accumulate[Range[0,200]]/3,IntegerQ] (* Harvey P. Dale, Oct 12 2014 *)
    CoefficientList[Series[x (1 + x + x^2) / ((1 + x)^2 (1 - x)^3), {x, 0, 70}], x] (* Vincenzo Librandi, Nov 04 2014 *)
    LinearRecurrence[{1,2,-2,-1,1},{0,1,2,5,7},70] (* Harvey P. Dale, Jun 05 2017 *)
    a[ n_] := With[{m = Quotient[n + 1, 2]}, m (3 m + (-1)^n) / 2]; (* Michael Somos, Jun 02 2018 *)
  • PARI
    {a(n) = (3*n^2 + 2*n + (n%2) * (2*n + 1)) / 8}; /* Michael Somos, Mar 24 2011 */
    
  • PARI
    {a(n) = if( n<0, n = -1-n); polcoeff( x * (1 - x^3) / ((1 - x) * (1-x^2))^2 + x * O(x^n), n)}; /* Michael Somos, Mar 24 2011 */
    
  • PARI
    {a(n) = my(m = (n+1) \ 2); m * (3*m + (-1)^n) / 2}; /* Michael Somos, Jun 02 2018 */
    
  • Python
    def a(n):
        p = n % 2
        return (n + p)*(3*n + 2 - p) >> 3
    print([a(n) for n in range(60)])  # Peter Luschny, Jul 15 2022
    
  • Python
    def A001318(n): return n*(n+1)-(m:=n>>1)*(m+1)>>1 # Chai Wah Wu, Nov 23 2024
  • Sage
    @CachedFunction
    def A001318(n):
        if n == 0 : return 0
        inc = n//2 if is_even(n) else n
        return inc + A001318(n-1)
    [A001318(n) for n in (0..59)] # Peter Luschny, Oct 13 2012
    

Formula

Euler: Product_{n>=1} (1 - x^n) = Sum_{n=-oo..oo} (-1)^n*x^(n*(3*n - 1)/2).
A080995(a(n)) = 1: complement of A090864; A000009(a(n)) = A051044(n). - Reinhard Zumkeller, Apr 22 2006
Euler transform of length-3 sequence [2, 2, -1]. - Michael Somos, Mar 24 2011
a(-1 - n) = a(n) for all n in Z. a(2*n) = A005449(n). a(2*n - 1) = A000326(n). - Michael Somos, Mar 24 2011. [The extension of the recurrence to negative indices satisfies the signature (1,2,-2,-1,1), but not the definition of the sequence m*(3*m -1)/2, because there is no m such that a(-1) = 0. - Klaus Purath, Jul 07 2021]
a(n) = 3 + 2*a(n-2) - a(n-4). - Ant King, Aug 23 2011
Product_{k>0} (1 - x^k) = Sum_{k>=0} (-1)^k * x^a(k). - Michael Somos, Mar 24 2011
G.f.: x*(1 + x + x^2)/((1 + x)^2*(1 - x)^3).
a(n) = n*(n + 1)/6 when n runs through numbers == 0 or 2 mod 3. - Barry E. Williams
a(n) = A008805(n-1) + A008805(n-2) + A008805(n-3), n > 2. - Ralf Stephan, Apr 26 2003
Sequence consists of the pentagonal numbers (A000326), followed by A000326(n) + n and then the next pentagonal number. - Jon Perry, Sep 11 2003
a(n) = (6*n^2 + 6*n + 1)/16 - (2*n + 1)*(-1)^n/16; a(n) = A034828(n+1) - A034828(n). - Paul Barry, May 13 2005
a(n) = Sum_{k=1..floor((n+1)/2)} (n - k + 1). - Paul Barry, Sep 07 2005
a(n) = A000217(n) - A000217(floor(n/2)). - Pierre CAMI, Dec 09 2007
If n even a(n) = a(n-1) + n/2 and if n odd a(n) = a(n-1) + n, n >= 2. - Pierre CAMI, Dec 09 2007
a(n)-a(n-1) = A026741(n) and it follows that the difference between consecutive terms is equal to n if n is odd and to n/2 if n is even. Hence this is a self-generating sequence that can be simply constructed from knowledge of the first term alone. - Ant King, Sep 26 2011
a(n) = (1/2)*ceiling(n/2)*ceiling((3*n + 1)/2). - Mircea Merca, Jul 13 2012
a(n) = (A008794(n+1) + A000217(n))/2 = A002378(n) - A085787(n). - Omar E. Pol, Jan 12 2013
a(n) = floor((n + 1)/2)*((n + 1) - (1/2)*floor((n + 1)/2) - 1/2). - Wesley Ivan Hurt, Jan 26 2013
From Oskar Wieland, Apr 10 2013: (Start)
a(n) = a(n+1) - A026741(n),
a(n) = a(n+2) - A001651(n),
a(n) = a(n+3) - A184418(n),
a(n) = a(n+4) - A007310(n),
a(n) = a(n+6) - A001651(n)*3 = a(n+6) - A016051(n),
a(n) = a(n+8) - A007310(n)*2 = a(n+8) - A091999(n),
a(n) = a(n+10)- A001651(n)*5 = a(n+10)- A072703(n),
a(n) = a(n+12)- A007310(n)*3,
a(n) = a(n+14)- A001651(n)*7. (End)
a(n) = (A007310(n+1)^2 - 1)/24. - Richard R. Forberg, May 27 2013; corrected by Zak Seidov, Mar 14 2015; further corrected by Jianing Song, Oct 24 2018
a(n) = Sum_{i = ceiling((n+1)/2)..n} i. - Wesley Ivan Hurt, Jun 08 2013
G.f.: x*G(0), where G(k) = 1 + x*(3*k + 4)/(3*k + 2 - x*(3*k + 2)*(3*k^2 + 11*k + 10)/(x*(3*k^2 + 11*k + 10) + (k + 1)*(3*k + 4)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 16 2013
Sum_{n>=1} 1/a(n) = 6 - 2*Pi/sqrt(3). - Vaclav Kotesovec, Oct 05 2016
a(n) = Sum_{i=1..n} numerator(i/2) = Sum_{i=1..n} denominator(2/i). - Wesley Ivan Hurt, Feb 26 2017
a(n) = A000292(A001651(n))/A001651(n), for n>0. - Ivan N. Ianakiev, May 08 2018
a(n) = ((-5 + (-1)^n - 6n)*(-1 + (-1)^n - 6n))/96. - José de Jesús Camacho Medina, Jun 12 2018
a(n) = Sum_{k=1..n} k/gcd(k,2). - Pedro Caceres, Apr 23 2019
Quadrisection. For r = 0,1,2,3: a(r + 4*k) = 6*k^2 + sqrt(24*a(r) + 1)*k + a(r), for k >= 1, with inputs (k = 0) {0,1,2,5}. These are the sequences A049453(k), A033570(k), A033568(k+1), A049452(k+1), for k >= 0, respectively. - Wolfdieter Lang, Feb 12 2021
a(n) = a(n-4) + sqrt(24*a(n-2) + 1), n >= 4. - Klaus Purath, Jul 07 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = 6*(log(3)-1). - Amiram Eldar, Feb 28 2022
a(n) = A002620(n) + A008805(n-1). Gary W. Adamson, Dec 10 2022
E.g.f.: (x*(7 + 3*x)*cosh(x) + (1 + 5*x + 3*x^2)*sinh(x))/8. - Stefano Spezia, Aug 01 2024

A118277 Generalized 9-gonal (or enneagonal) numbers: m*(7*m - 5)/2 with m = 0, 1, -1, 2, -2, 3, -3, ...

Original entry on oeis.org

0, 1, 6, 9, 19, 24, 39, 46, 66, 75, 100, 111, 141, 154, 189, 204, 244, 261, 306, 325, 375, 396, 451, 474, 534, 559, 624, 651, 721, 750, 825, 856, 936, 969, 1054, 1089, 1179, 1216, 1311, 1350, 1450, 1491, 1596, 1639, 1749, 1794, 1909, 1956, 2076, 2125, 2250
Offset: 0

Views

Author

T. D. Noe, Apr 21 2006

Keywords

Comments

Partial sums of A195140. - Omar E. Pol, Sep 13 2011
The characteristic function starts 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 , ... and has the generating function f(x,x^6) in terms of Ramanujan's two-variable theta function. See A080995, A010054, A133100 etc. - Omar E. Pol, Jul 13 2012
Also A179986 and positive terms of A001106 interleaved. - Omar E. Pol, Aug 04 2012
Sequence provides all integers m such that 56*m + 25 is a square. - Bruno Berselli, Oct 07 2015

Crossrefs

Cf. A001106 (9-gonal numbers).
Column 5 of A195152.
Cf. A195140.
Sequences of generalized k-gonal numbers: A001318 (k=5), A000217 (k=6), A085787 (k=7), A001082 (k=8), this sequence (k=9), A074377 (k=10), A195160 (k=11), A195162 (k=12), A195313 (k=13), A195818 (k=14), A277082 (k=15), A274978 (k=16), A303305 (k=17), A274979 (k=18), A303813 (k=19), A218864 (k=20), A303298 (k=21), A303299 (k=22), A303303 (k=23), A303814 (k=24), A303304 (k=25), A316724 (k=26), A316725 (k=27), A303812 (k=28), A303815 (k=29), A316729 (k=30).

Programs

  • Magma
    [7*n^2/8+7*n/8-3/16+3*(-1)^n*(1/16+n/8): n in [0..50]]; // Vincenzo Librandi, Oct 10 2011
    
  • Mathematica
    n=9; Union[Table[i((n-2)i-(n-4))/2, {i,-30,30}]]
    LinearRecurrence[{1,2,-2,-1,1},{0,1,6,9,19},60] (* Harvey P. Dale, Jun 08 2016 *)
  • PARI
    a(n)=7*n*(n+1)/8-3/16+3*(-1)^n*(1+2*n)/16 \\ Charles R Greathouse IV, Jan 18 2012

Formula

a(n) = n*(7*n-5)/2 for positive and negative n.
a(n) = (1/16)*(14*n^2 + 14*n - 3 + 3*(-1)^n*(2*n + 1)). - R. J. Mathar, Oct 08 2011
G.f.: x*(1+5*x+x^2) / ( (1+x)^2*(1-x)^3 ). - R. J. Mathar, Oct 08 2011
Sum_{n>=1} 1/a(n) = 2*(7 + 5*Pi*tan(3*Pi/14))/25. - Vaclav Kotesovec, Oct 05 2016
E.g.f.: (1/16)*(3*(1 - 2*x)*exp(-x) + (-3 + 28*x + 14*x^2)*exp(x)). - G. C. Greubel, Aug 19 2017

Extensions

Extended Name by Omar E. Pol, Jul 28 2018

A175003 Triangle read by rows demonstrating Euler's pentagonal theorem for partition numbers.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 5, 3, -1, 7, 5, -1, 11, 7, -2, -1, 15, 11, -3, -1, 22, 15, -5, -2, 30, 22, -7, -3, 42, 30, -11, -5, 56, 42, -15, -7, 1, 77, 56, -22, -11, 1, 101, 77, -30, -15, 2, 135, 101, -42, -22, 3, 1, 176, 135, -56, -30, 5, 1, 231, 176, -77, -42, 7, 2
Offset: 1

Views

Author

Gary W. Adamson, Apr 03 2010

Keywords

Comments

Row sums = A000041 starting with offset 1.
Sum of n-th row terms = leftmost term of next row, such that terms in each row demonstrate Euler's pentagonal theorem.
Let Q = triangle A027293 with partition numbers in each column.
Let M = a diagonalized variant of A080995 as the characteristic function of the generalized pentagonal numbers starting with offset 1: (1, 1, 0, 0, 1,...)
Sign the 1's: (++--++...) getting (1, 1, 0, 0, -1, 0, -1,...) which is the diagonal of matrix M, (as an infinite lower triangular matrix with the rest zeros).
Triangle A175003 = Q*M, with deleted zeros.
Column k starts at row A001318(k). - Omar E. Pol, Sep 21 2011
From Omar E. Pol, Apr 22 2014: (Start)
Row n has length A235963(n).
For Euler's pentagonal theorem for the sum of divisors see A238442.
Note that both of Euler's pentagonal theorems refer to generalized pentagonal numbers (A001318), not to pentagonal numbers (A000326). (End)

Examples

			Triangle begins:
    1;
    1,   1;
    2,   1;
    3,   2;
    5,   3,  -1;
    7,   5,  -1;
   11,   7,  -2,  -1;
   15,  11,  -3,  -1;
   22,  15,  -5,  -2;
   30,  22,  -7,  -3;
   42,  30, -11,  -5;
   56,  42, -15,  -7,   1;
   77,  56, -22, -11,   1;
  101,  77, -30, -15,   2;
  ...
		

Crossrefs

Formula

T(n,k) = A057077(k-1)*A000041(A195310(n,k)), n >= 1, k >= 1. - Omar E. Pol, Sep 21 2011

Extensions

Corrected and extended by Omar E. Pol, Feb 14 2013

A090864 Complement of generalized pentagonal numbers (A001318).

Original entry on oeis.org

3, 4, 6, 8, 9, 10, 11, 13, 14, 16, 17, 18, 19, 20, 21, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84
Offset: 1

Views

Author

Jon Perry, Feb 12 2004

Keywords

Comments

Also n for which A006906(n) is even, or equivalently n for which A000009(n) is even (since A006906 and A000009 have the same parity).
The number of partitions of a(n) into distinct parts with an even number of parts equals the number of such partitions with an odd number of parts: A067661(a(n)) = A067659(a(n)). See, e.g., the Freitag-Busam reference, p. 410 given in A036499. - Wolfdieter Lang, Jan 19 2016

Crossrefs

Programs

  • Mathematica
    Complement[Range[200], Select[Accumulate[Range[0,200]]/3, IntegerQ]] (* G. C. Greubel, Jun 06 2017 *)
  • PARI
    a(n) = my(q,r); [q,r]=divrem(sqrtint(24*n),3); n + q + (r >= bitnegimply(1,q)); \\ Kevin Ryde, Sep 15 2024
  • Python
    from math import isqrt
    def A090864(n):
        def f(x): return n+(m:=isqrt(24*x+1)+1)//6+(m-2)//6
        kmin, kmax = 0,1
        while f(kmax) > kmax:
            kmax <<= 1
        while kmax-kmin > 1:
            kmid = kmax+kmin>>1
            if f(kmid) <= kmid:
                kmax = kmid
            else:
                kmin = kmid
        return kmax # Chai Wah Wu, Aug 29 2024
    

Formula

A080995(a(n)) = 0; A000009(a(n)) = A118303(n). - Reinhard Zumkeller, Apr 22 2006
A010815(a(n)) = A067661(a(n)) - A067659(a(n)) = 0, n >= 1. See a comment above. - Wolfdieter Lang, Jan 19 2016
a(n) = n+1 + A085141(n-1) + A111651(n). - Kevin Ryde, Sep 15 2024

Extensions

More terms from Reinhard Zumkeller, Apr 22 2006
Edited by Ray Chandler, Dec 14 2011
Edited by Jon E. Schoenfield, Nov 25 2016

A089801 a(n) = 0 unless n = 3j^2 + 2j or 3j^2 + 4j + 1 for some j >= 0, in which case a(n) = 1.

Original entry on oeis.org

1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 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, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0
Offset: 0

Views

Author

Eric W. Weisstein, Nov 12 2003

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Also characteristic function of generalized octagonal numbers A001082. - Omar E. Pol, Jul 13 2012
Number 12 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^5 + x^8 + x^16 + x^21 + x^33 + x^40 + x^56 + x^65 + x^85 + ...
G.f. = q + q^4 + q^16 + q^25 + q^49 + q^64 + q^100 + q^121 + q^169 + q^196 + ...
		

Crossrefs

Programs

  • Magma
    Basis( ModularForms( Gamma0(36), 1/2), 87) [2]; /* Michael Somos, Jul 02 2014 */
    
  • Maple
    A089801 := proc(n)
            A033684(3*n+1) ;
    end proc: # R. J. Mathar, Oct 07 2011
    M:=33;
    S:=f->series(f,q,500);
    L:=f->seriestolist(f);
    X:=add(q^(3*n^2+2*n),n=-M..M);
    S(%);
    L(%); # N. J. A. Sloane, Jan 31 2012
    eps:=Array(0..120,0);
    for j from 0 to 120 do
    if 3*j^2+2*j <= 120 then eps[3*j^2+2*j] := 1; fi;
    if 3*j^2+4*j+1 <= 120 then eps[3*j^2+4*j+1] := 1; fi;
    end do;  # N. J. A. Sloane, Aug 12 2017
  • Mathematica
    a[ n_] := SeriesCoefficient[ (1/2) x^(-1/3) (EllipticTheta[ 3, 0, x^(1/3)] - EllipticTheta[ 3, 0, x^3]), {x, 0, n}]; (* Michael Somos, Jun 29 2012 *)
    a[ n_] := SeriesCoefficient[ 2^(-1/2) x^(-3/8) QPochhammer[ -x, x^2] EllipticTheta[ 2, Pi/4, x^(3/2)], {x, 0, n}]; (* Michael Somos, Jun 29 2012 *)
  • PARI
    {a(n) = issquare(3*n + 1)}; /* Michael Somos, Apr 12 2005 */
    
  • Python
    from sympy.ntheory.primetest import is_square
    def A089801(n): return int(is_square(3*n+1)) # Chai Wah Wu, May 17 2023

Formula

G.f.: Sum_{n=-oo..oo} q^(3n^2+2n).
Expansion of Jacobi theta function (theta_3(q^(1/3)) - theta_3(q^3))/(2 q^(1/3)) in powers of q.
Euler transform of period 12 sequence [1, -1, 0, 0, 1, -1, 1, 0, 0, -1, 1, -1, ...]. - Michael Somos, Apr 12 2005
a(n) = b(3*n + 1) where b() is multiplicative with b(3^e) = 0^e, b(p^e) = (1 + (-1)^e) / 2 if p != 3. - Michael Somos, Jun 06 2005; b=A033684. - R. J. Mathar, Oct 07 2011
Expansion of q^(-1/3) * eta(q^2)^2 * eta(q^3) * eta(q^12) / (eta(q) * eta(q^4) * eta(q^6)) in powers of q. - Michael Somos, Apr 12 2005
Expansion of chi(x) * psi(-x^3) in powers of x where chi(), psi() are Ramanujan theta functions. - Michael Somos, Apr 19 2007
Expansion of f(x, x^5) in powers of x where f(, ) is Ramanujan's general theta function. - Michael Somos, Jun 29 2012
G.f. is a period 1 Fourier series which satisfies f(-1 / (36 t)) = 2^(1/2) (t/i)^(1/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A089807.
a(8*n + 4) = a(4*n + 2) = a(4*n + 3) = 0, a(4*n + 1) = a(n), a(8*n) = A080995(n). - Michael Somos, Jan 28 2011
a(n) = (-1)^n * A089802(n).
For n > 0, a(n) = b(n)-b(n-1) + c(n)-c(n-1), where b(n) = floor(sqrt(n/3+1/9)+2/3) and c(n) = floor(sqrt(n/3+1/9)+4/3). - Mikael Aaltonen, Jan 22 2015
a(n) = A033684(3*n + 1). - Michael Somos, Jan 10 2017

Extensions

Edited with simpler definition by N. J. A. Sloane, Jan 31 2012
Further edited by N. J. A. Sloane, Aug 12 2017
Showing 1-10 of 40 results. Next