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.

A007294 Number of partitions of n into nonzero triangular numbers.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 4, 4, 4, 6, 7, 7, 10, 11, 11, 15, 17, 17, 22, 24, 25, 32, 35, 36, 44, 48, 50, 60, 66, 68, 81, 89, 92, 107, 117, 121, 141, 153, 159, 181, 197, 205, 233, 252, 262, 295, 320, 332, 372, 401, 417, 465, 501, 520, 575, 619, 645, 710, 763
Offset: 0

Views

Author

Keywords

Comments

Also number of decreasing integer sequences l(1) >= l(2) >= l(3) >= .. 0 such that sum('i*l(i)','i'=1..infinity)=n.
a(n) is also the number of partitions of n such that #{parts equal to i} >= #{parts equal to j} if i <= j.
Also the number of partitions of n (necessarily into distinct parts) where the part sizes are monotonically decreasing (including the last part, which is the difference between the last part and a "part" of size 0). These partitions are the conjugates of the partitions with number of parts of size i increasing. - Franklin T. Adams-Watters, Apr 08 2008
Also partitions with condition as in A179255, and additionally, if more than one part, first difference >= first part: for example, a(10)=7 as there are 7 such partitions of 10: 1+2+3+4 = 1+2+7 = 1+3+6 = 1+9 = 2+8 = 3+7 = 10. - Joerg Arndt, Mar 22 2011
Number of members of A181818 with a bigomega value of n (cf. A001222). - Matthew Vandermast, May 19 2012

Examples

			6 = 3+3 = 3+1+1+1 = 1+1+1+1+1+1 so a(6) = 4.
a(7)=4: Four sequences as above are (7,0,..), (5,1,0,..), (3,2,0,..),(2,1,1,0,..). They correspond to the partitions 1^7, 2 1^5, 2^2 1^3, 3 2 1^2 of seven or in the main description to the partitions 1^7, 3 1^4, 3^2 1, 6 1.
From _Gus Wiseman_, May 03 2019: (Start)
The a(1) = 1 through a(9) = 6 partitions using nonzero triangular numbers are the following. The Heinz numbers of these partitions are given by A325363.
  1   11   3     31     311     6        61        611        63
           111   1111   11111   33       331       3311       333
                                3111     31111     311111     6111
                                111111   1111111   11111111   33111
                                                              3111111
                                                              111111111
The a(1) = 1 through a(10) = 7 partitions with weakly decreasing multiplicities are the following. Equivalent to Matthew Vandermast's comment, the Heinz numbers of these partitions are given by A025487 (products of primorial numbers).
  1  11  21   211   2111   321     3211     32111     32211      4321
         111  1111  11111  2211    22111    221111    222111     322111
                           21111   211111   2111111   321111     2221111
                           111111  1111111  11111111  2211111    3211111
                                                      21111111   22111111
                                                      111111111  211111111
                                                                 1111111111
The a(1) = 1 through a(11) = 7 partitions with weakly increasing differences (where the last part is taken to be zero) are the following. The Heinz numbers of these partitions are given by A325362 (A = 10, B = 11).
  (1)  (2)  (3)   (4)   (5)   (6)    (7)    (8)    (9)    (A)     (B)
            (21)  (31)  (41)  (42)   (52)   (62)   (63)   (73)    (83)
                              (51)   (61)   (71)   (72)   (82)    (92)
                              (321)  (421)  (521)  (81)   (91)    (A1)
                                                   (531)  (631)   (731)
                                                   (621)  (721)   (821)
                                                          (4321)  (5321)
(End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A102462.
Row sums of array A176723 and triangle A176724. - Wolfdieter Lang, Jul 19 2010
Cf. A179255 (condition only on differences), A179269 (parts strictly increasing instead of nondecreasing). - Joerg Arndt, Mar 22 2011
Row sums of A319797.

Programs

  • Haskell
    a007294 = p $ tail a000217_list where
       p _      0 = 1
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Jun 28 2013
    
  • Maple
    b:= proc(n,i) option remember;
          if n<0 then 0
        elif n=0 then 1
        elif i=0 then 0
        else b(n, i-1) +b(n-i*(i+1)/2, i)
          fi
        end:
    a:= n-> b(n, floor(sqrt(2*n))):
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 22 2011
    isNondecrP :=proc(L) slp := DIFF(DIFF(L)) ; min(op(%)) >= 0 ; end proc:
    A007294 := proc(n) local a, p; a := 0 ; if n = 0 then return 1 ; end if; for p in combinat[partition](n) do if nops(p) = nops(convert(p, set)) then if isNondecrP(p) then if nops(p) =1 then a := a+1 ; elif op(2, p) >= 2*op(1, p) then a := a+1; end if; end if; end if; end do; a ; end proc:
    seq(A007294(n), n=0..30) ; # R. J. Mathar, Jan 07 2011
  • Mathematica
    CoefficientList[ Series[ 1/Product[1 - x^(i(i + 1)/2), {i, 1, 50}], {x, 0, 70}], x]
    (* also *)
    t = Table[n (n + 1)/2, {n, 1, 200}] ; p[n_] := IntegerPartitions[n, All, t]; Table[p[n], {n, 0, 12}] (*shows partitions*)
    a[n_] := Length@p@n; a /@Range[0, 80]
    (* Clark Kimberling, Mar 09 2014 *)
    b[n_, i_] := b[n, i] = Which[n < 0, 0, n == 0, 1, i == 0, 0, True, b[n, i-1]+b[n-i*(i+1)/2, i]]; a[n_] := b[n, Floor[Sqrt[2*n]]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Apr 09 2014, after Alois P. Heinz *)
    Table[Length[Select[IntegerPartitions[n],OrderedQ[Differences[Append[#,0]]]&]],{n,0,30}] (* Gus Wiseman, May 03 2019 *)
    nmax = 58; t = Table[PolygonalNumber[n], {n, nmax}];
    Table[Count[IntegerPartitions@n, x_ /; SubsetQ[t, x]], {n, 0, nmax}] (* Robert Price, Aug 02 2020 *)
  • PARI
    N=66; Vec(1/prod(k=1,N,1-x^(k*(k+1)\2))+O(x^N)) \\ Joerg Arndt, Apr 14 2013
    
  • Python
    from functools import lru_cache
    from sympy import divisors
    from sympy.ntheory.primetest import is_square
    @lru_cache(maxsize=None)
    def A007294(n):
        @lru_cache(maxsize=None)
        def a(n): return is_square((n<<3)+1)
        @lru_cache(maxsize=None)
        def c(n): return sum(d for d in divisors(n,generator=True) if a(d))
        return (c(n)+sum(c(k)*A007294(n-k) for k in range(1,n)))//n if n else 1 # Chai Wah Wu, Jul 15 2024
  • Sage
    def A007294(n):
        has_nondecreasing_diffs = lambda x: min(differences(x, 2)) >= 0
        special = lambda x: (x[1]-x[0]) >= x[0]
        allowed = lambda x: (len(x) < 2 or special(x)) and (len(x) < 3 or has_nondecreasing_diffs(x))
        return len([1 for x in Partitions(n, max_slope=-1) if allowed(x[::-1])]) # D. S. McNeil, Jan 06 2011
    

Formula

G.f.: 1/Product_{k>=2} (1-z^binomial(k, 2)).
For n>0: a(n) = b(n, 1) where b(n, k) = if n>k*(k+1)/2 then b(n-k*(k+1)/2, k) + b(n, k+1) else (if n=k*(k+1)/2 then 1 else 0). - Reinhard Zumkeller, Aug 26 2003
For n>0, a(n) is Euler Transform of [1,0,1,0,0,1,0,0,0,1,0,0,0,0,1,...], i.e A010054, n>0. - Benedict W. J. Irwin, Jul 29 2016
a(n) ~ exp(3*Pi^(1/3) * Zeta(3/2)^(2/3) * n^(1/3) / 2) * Zeta(3/2) / (2^(7/2) * sqrt(3) * Pi * n^(3/2)) [Brigham 1950 (exponential part), Almkvist 2006]. - Vaclav Kotesovec, Dec 31 2016
G.f.: Sum_{i>=0} x^(i*(i+1)/2) / Product_{j=1..i} (1 - x^(j*(j+1)/2)). - Ilya Gutkovskiy, May 07 2017

Extensions

Additional comments from Roland Bacher, Jun 17 2001