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

A238517 Square row sums of the table A008289 (A060016).

Original entry on oeis.org

1, 1, 1, 2, 2, 5, 6, 11, 14, 26, 34, 52, 79, 110, 162, 231, 328, 446, 660, 872, 1236, 1660, 2327, 3060, 4238, 5586, 7595, 9988, 13376, 17470, 23318, 30286, 39744, 51676, 67276, 86929, 112390, 144472, 185428, 237826, 303171, 386468, 490838, 622882, 786068, 995118, 1249838, 1573522, 1970542
Offset: 0

Views

Author

Emanuele Munarini, Feb 28 2014

Keywords

Crossrefs

Programs

  • Mathematica
    qq[n_] := CoefficientList[Series[Sum[x^Binomial[k+1,2]y^k/Product[1-x^i,{i,1,k}],{k,0,n}],{x,0,n},{y,0,n}],{x,y}]
    Total[Transpose[Map[#^2 &, qq[100]]]]

Formula

a(n) = sum(q(n,k)^k,k=0..n), where q(n,k) is the number of partitions of n into k distinct parts (A008289, A060016).

A008284 Triangle of partition numbers: T(n,k) = number of partitions of n in which the greatest part is k, 1 <= k <= n. Also number of partitions of n into k positive parts, 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 3, 3, 2, 1, 1, 1, 3, 4, 3, 2, 1, 1, 1, 4, 5, 5, 3, 2, 1, 1, 1, 4, 7, 6, 5, 3, 2, 1, 1, 1, 5, 8, 9, 7, 5, 3, 2, 1, 1, 1, 5, 10, 11, 10, 7, 5, 3, 2, 1, 1, 1, 6, 12, 15, 13, 11, 7, 5, 3, 2, 1, 1, 1, 6, 14, 18, 18, 14, 11, 7, 5, 3, 2, 1, 1, 1, 7, 16, 23, 23, 20, 15, 11, 7, 5, 3, 2, 1, 1
Offset: 1

Views

Author

Keywords

Comments

From Frederik Beaujean (beaujean(AT)mpp.mpg.de), Apr 09 2010: (Start)
A000041(n+1) = 1 + Sum_{r=1..n} Sum_{k=1..min(r,n-r+1)} T(r,k).
T(n, n-k) is also the number of partitions of k in which the greatest part is at most n-k. (End)
From Richard R. Forberg, Dec 26 2014: (Start)
Elements of T(n, k) for n <= 2+3k, equal A000041(n-k) - A000070(n-2k-1), with the assumption A000070(n) = 0 for n < 0.
The diagonal T(2+2k, k), for k > 1 equals A007042, and the diagonal T(3+3k,k), for k >= 1, equals A104384. (End)
T(-n, k) is used as a definition for A380038, which can therefore be seen as an extension of this sequence for negative n. - Friedjof Tellkamp, Jan 18 2025

Examples

			The triangle T(n,k) begins:
   n\k 1  2  3  4  5  6  7  8  9 10 11 12 ...
   1:  1
   2:  1  1
   3:  1  1  1
   4:  1  2  1  1
   5:  1  2  2  1  1
   6:  1  3  3  2  1  1
   7:  1  3  4  3  2  1  1
   8:  1  4  5  5  3  2  1  1
   9:  1  4  7  6  5  3  2  1  1
  10:  1  5  8  9  7  5  3  2  1  1
  11:  1  5 10 11 10  7  5  3  2  1  1
  12:  1  6 12 15 13 11  7  5  3  2  1  1
... Reformatted and extended by _Wolfdieter Lang_, Dec 03 2012; additional extension by _Bob Selcoe_, Jun 09 2013
T(7,3) = 4 because we have [3,3,1], [3,2,2], [3,2,1,1] and [3,1,1,1,1], each having greatest part 3; or [5,1,1], [4,2,1], [3,3,1] and [3,2,2] each having 3 parts.
* Example from formula above: T(10,4) = 9 because T(6,4) + T(6,3) + T(6,2) + T(6,1) = 2 + 3 + 3 + 1 = 9.
* P(n) = P(n-1) + DT(n-1). P(n) = unordered partitions of n. (A000041) DT(n-1) = sum of diagonals beginning at T(n-1,1).
Example P(11) = 56, P(10) = 42, sum DT(10) = 1 + 4 + 5 + 3 + 1 = 14. - _Bob Selcoe_, Jun 09 2013
From _Omar E. Pol_, Nov 19 2019: (Start)
Illustration of initial terms: T(n,k) is also the number of vertical line segments in the k-th column of the n-th diagram, which represents the partitions of n:
.
    1    1 1    1 1 1    1 2 1 1    1 2 2 1 1    1 3 3 2 1 1    1 3 4 3 2 1 1
.
   _|   _| |   _| | |   _| | | |   _| | | | |   _| | | | | |   _| | | | | | |
        _ _|   _ _| |   _ _| | |   _ _| | | |   _ _| | | | |   _ _| | | | | |
               _ _ _|   _ _ _| |   _ _ _| | |   _ _ _| | | |   _ _ _| | | | |
                        _ _|   |   _ _|   | |   _ _|   | | |   _ _|   | | | |
                        _ _ _ _|   _ _ _ _| |   _ _ _ _| | |   _ _ _ _| | | |
                                   _ _ _|   |   _ _ _|   | |   _ _ _|   | | |
                                   _ _ _ _ _|   _ _ _ _ _| |   _ _ _ _ _| | |
                                                _ _|   |   |   _ _|   |   | |
                                                _ _ _ _|   |   _ _ _ _|   | |
                                                _ _ _|     |   _ _ _|     | |
                                                _ _ _ _ _ _|   _ _ _ _ _ _| |
                                                               _ _ _|   |   |
                                                               _ _ _ _ _|   |
                                                               _ _ _ _|     |
                                                               _ _ _ _ _ _ _|
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, pp. 94, 96 and 307.
  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 219.
  • D. E. Knuth, The Art of Computer Programming, Volume 4, Fascicle 3: Generating All Combinations and Partitions, Addison-Wesley Professional, 2005, pp. 38, 45, 50 [From Frederik Beaujean (beaujean(AT)mpp.mpg.de), Apr 09 2010]
  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.4, p. 400.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section XIV.2, p. 493.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 294.

Crossrefs

A000041 is row sums and diagonal.
Partial sums of rows gives A026820.
Read from right to left gives A058398.
Subtriangle of A072233 without row n=0 and column m=0.
Cf. A007042, A104384 which are diagonals with slope -2, -3.

Programs

  • Haskell
    a008284 n k = a008284_tabl !! (n-1) !! (k-1)
    a008284_row n = a008284_tabl !! (n-1)
    a008284_tabl = [1] : f [[1]] where
       f xss = ys : f (ys : xss) where
         ys = (map sum $ zipWith take [1..] xss) ++ [1]
    -- Reinhard Zumkeller, Sep 05 2014
    
  • Maple
    G:=-1+1/product(1-t*x^j,j=1..15): Gser:=simplify(series(G,x=0,17)): for n from 1 to 14 do P[n]:=coeff(Gser,x^n) od: for n from 1 to 14 do seq(coeff(P[n],t^j),j=1..n) od; # yields sequence in triangular form; Emeric Deutsch, Feb 12 2006
    with(combstruct):for n from 0 to 18 do seq(count(Partition(n), size=m), m = 1 .. n) od; # Zerinvary Lajos, Mar 30 2009
    T := proc(n,k) option remember; if k < 0 or n < 0 then 0 elif k = 0 then if n = 0 then 1 else 0 fi else T(n - 1, k - 1) + T(n - k, k) fi end: seq(print(seq(T(n, k), k=1..n)),n=1..14); # Peter Luschny, Jul 24 2011
  • Mathematica
    Column[Table[ IntegerPartitions[n, {k}] // Length, {n, 1, 20}, {k, 1, n}], Center] (* Frederik Beaujean (beaujean(AT)mpp.mpg.de), Apr 09 2010 *)
    (*Recurrence closely related to natural numbers and number of divisors of n*)
    Clear[t]; nn = 14; t[n_, 1] = 1; t[n_, k_] := t[n, k] = If[n >= k, Sum[t[n - i, k - 1], {i, 1, n - 1}] - Sum[t[n - i, k], {i, 1, k - 1}], 0];Flatten[Table[Table[t[n, k], {k, 1, n}], {n, 1, nn}]][[1 ;; 96]] (* Mats Granvik, Jan 01 2015 *)
    Table[SeriesCoefficient[1/QPochhammer[a q, q], {q, 0, n}, {a, 0, k}], {n, 1, 15}, {k, 1, n}] // Column (* Vladimir Reshetnikov, Nov 18 2016 *)
    T[n_, k_] := T[n, k] = If[n>0 && k>0, T[n-1, k-1] + T[n-k, k], Boole[n==0 && k==0]]
    Table[T[n, k], {n, 1, 20}, {k, 1, n}] // Flatten (* Robert A. Russell, May 12 2018 after Knuth 7.2.1.4 (39) *)
  • PARI
    T(n,k)=#partitions(n-k,k)
    for(n=1,9,for(k=1,n,print1(T(n,k)", "))) \\ Charles R Greathouse IV, Jan 04 2016
    
  • PARI
    A8284=[]; A008284(n,k)={for(n=#A8284+1,n,A8284=concat(A8284,[vector(n,k,if(2*k1,A8284[n-k][k]+A8284[n-1][k-1],1),numbpart(n-k)))]));if(k,A8284[n][k],A8284[n])} \\ Without 2nd argument, return row n. - M. F. Hasler, Sep 26 2017
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A008284_T(n,k):
        if k==n or k==1: return 1
        if k>n: return 0
        return A008284_T(n-1,k-1)+A008284_T(n-k,k) # Chai Wah Wu, Sep 21 2023
  • Sage
    from sage.combinat.partition import number_of_partitions_length
    [[number_of_partitions_length(n, k) for k in (1..n)] for n in (1..12)] # Peter Luschny, Aug 01 2015
    

Formula

T(n, k) = Sum_{i=1..k} T(n-k, i), for 1 <= k <= n-1; T(n, n) = 1 for n >= 1.
Or, T(n, 1) = T(n, n) = 1, T(n, k) = 0 (k > n), T(n, k) = T(n-1, k-1) + T(n-k, k).
G.f. for k-th column: x^k/(Product_{j=1..k} (1-x^j)). - Wolfdieter Lang, Nov 29 2000
G.f.: A(x, y) = Product_{n>=1} 1/(1-x^n)^(P_n(y)/n), where P_n(y) = Sum_{d|n} eulerphi(n/d)*y^d. - Paul D. Hanna, Jul 13 2004
If k >= n/2, T(n,k) = T(2(n-k),n-k) = A000041(n-k). - Franklin T. Adams-Watters, Jan 12 2006 [Relation included by Hans Loeblich, Apr 16 2019, relation extended by Evan Robinson, Jun 30 2021]
G.f.: G(t,x) = -1 + 1/Product_{j>=1} (1-t*x^j). - Emeric Deutsch, Feb 12 2006
A002865(n) = Sum_{k=2..floor((n+2)/2)} T(n-k+1,k-1). - Reinhard Zumkeller, Nov 04 2007
A000700(n) = Sum_{k=1..n} (-1)^(n-k) T(n,k). - Jeremy L. Martin, Jul 06 2013
G.f.: -1 + e^(F(x,z)), where F(x,z) = Sum_{n >= 1} (x*z)^n/(n*(1 - z^n)) is a g.f. for A126988. - Peter Bala, Jan 13 2015
Also, T(n, n-k) = k for k = 1, 2, 3; n >= 2k. T(n, 2) = floor(n/2). T(n, 3) = round(n^2/12). - M. F. Hasler, Sep 26 2017
T(n,k) = [n>0 & k>0] * (T(n-1,k-1) + T(n-k,k)) + [n==0 & k==0]. - Robert A. Russell, May 12 2018 from Knuth 7.2.1.4 (39)
T(n, k) = Sum_{i=0..n-1} T(n-ik-1, k-1) for k >= 1; T(-n, k) = 0 for n > 0; T(n, 0) = [n==0]. - Joshua Swanson (writing for Juexian Li), May 24 2020

A008289 Triangle read by rows: Q(n,m) = number of partitions of n into m distinct parts, n>=1, m>=1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 3, 1, 1, 3, 2, 1, 4, 3, 1, 4, 4, 1, 1, 5, 5, 1, 1, 5, 7, 2, 1, 6, 8, 3, 1, 6, 10, 5, 1, 7, 12, 6, 1, 1, 7, 14, 9, 1, 1, 8, 16, 11, 2, 1, 8, 19, 15, 3, 1, 9, 21, 18, 5, 1, 9, 24, 23, 7, 1, 10, 27, 27, 10, 1, 1, 10, 30, 34, 13, 1, 1, 11, 33, 39, 18, 2, 1, 11, 37
Offset: 1

Views

Author

Keywords

Comments

Row n contains A003056(n) = floor((sqrt(8*n+1)-1)/2) terms (number of terms increases by one at each triangular number). - Michael Somos, Dec 04 2002
Row sums give A000009.
Q(n,m) is the number of partitions of n whose greatest part is m and every number in {1,2,...,m} occurs as a part at least once. - Geoffrey Critzer, Nov 17 2011

Examples

			Q(8,3) = 2 since 8 can be written in 2 ways as sum of 3 distinct positive integers: 5+2+1 and 4+3+1.
Triangle starts:
  1;
  1;
  1,  1;
  1,  1;
  1,  2;
  1,  2,  1;
  1,  3,  1;
  1,  3,  2;
  1,  4,  3;
  1,  4,  4,  1;
  1,  5,  5,  1;
  1,  5,  7,  2;
  1,  6,  8,  3;
  1,  6, 10,  5;
  1,  7, 12,  6,  1;
  1,  7, 14,  9,  1;
  1,  8, 16, 11,  2;
  1,  8, 19, 15,  3;
  1,  9, 21, 18,  5;
  1,  9, 24, 23,  7;
  1, 10, 27, 27, 10,  1;
  1, 10, 30, 34, 13,  1;
  1, 11, 33, 39, 18,  2;
  1, 11, 37, 47, 23,  3;
  1, 12, 40, 54, 30,  5;
  1, 12, 44, 64, 37,  7;
  1, 13, 48, 72, 47, 11;
  1, 13, 52, 84, 57, 14, 1;
  1, 14, 56, 94, 70, 20, 1; ...
Q(8,3) = 2 because there are 2 partitions of 8 in which  1, 2 and 3 occur as a part at least once: (3,2,2,1), (3,2,1,1,1). - _Geoffrey Critzer_, Nov 17 2011
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 115.

Crossrefs

Sum of n-th row is A000009(n). Sum(Q(n,k)*k, k>=1) = A015723(n).
A060016 is another version.
Cf. A032020.

Programs

  • Maple
    g:=product(1+t*x^j,j=1..40): gser:=simplify(series(g,x=0,32)): P[0]:=1: for n from 1 to 30 do P[n]:=sort(coeff(gser,x^n)) od: for n from 1 to 25 do seq(coeff(P[n],t,j),j=1..floor((sqrt(8*n+1)-1)/2)) od; # yields sequence in triangular form; Emeric Deutsch, Feb 21 2006
    # second Maple program:
    b:= proc(n, i) b(n, i):= `if`(n=0, [1], `if`(i<1, [], zip((x, y)
          -> x+y, b(n, i-1), `if`(i>n, [], [0, b(n-i, i-1)[]]), 0)))
        end:
    T:= n-> subsop(1=NULL, b(n, n))[]:
    seq(T(n), n=1..40);  # Alois P. Heinz, Nov 18 2012
  • 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]]]; Take[ Flatten[ Table[q[n, k], {n, 1, 24}, {k, 1, Floor[(Sqrt[8n+1] - 1)/2]}]], 91] (* Jean-François Alcover, Aug 01 2011, after PARI prog. *)
    (* As a triangular table: *)
    Table[Coefficient[Series[Product[1+t    x^i,{i,n}],{x,0,n}],x^n t^m],{n,24},{m,n}] (* Wouter Meeussen, Feb 22 2014 *)
    Table[Count[PowersRepresentations[n, k, 1], ?(Nor[MemberQ[#, 0], MemberQ[Differences@ #, 0]] &)], {n, 23}, {k, Floor[(Sqrt[8 n + 1] - 1)/2]}] // Flatten (* _Michael De Vlieger, Jul 12 2017 *)
    nrows = 24; d=Table[Select[IntegerPartitions[n], DeleteDuplicates[#] == # &],{n, nrows}] ;
    Flatten@Table[Table[Count[d[[n]], x_ /; Length[x] == m], {m, Floor[(Sqrt[8 n + 1] - 1)/2]}], {n, nrows}] (* Robert Price, Aug 17 2020 *)
  • PARI
    {Q(n, k) = if( k<0 || k>n,0, polcoeff( polcoeff( prod(i=1, n, 1 + y*x^i, 1 + x * O(x^n)), n), k))}; /* Michael Somos, Dec 04 2002 */
    
  • PARI
    Q(n,k)=if(nPaul D. Hanna
    
  • PARI
    {Q(n, k) = my(u); if( n<1 || k<1 || k>(sqrtint(8*n+1)-1)\2, 0, u = n - k *(k+1)/2; polcoeff( 1 / prod(i=1, k, 1 - x^i, 1 + x*O(x^u)), u))}; /* Michael Somos, Jul 11 2017 */
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A008289_T(n,k):
        if k<1 or nA008289_T(n-k,k)+A008289_T(n-k,k-1) # Chai Wah Wu, Sep 22 2023

Formula

G.f.: Product_{n>0} (1 + y*x^n) = 1 + Sum_{n>0, k>0} Q(n, k) * x^n * y^k. - Michael Somos, Dec 04 2002
Q(n, k) = Q(n-k, k) + Q(n-k, k-1) for n>k>=1, with Q(1, 1)=1, Q(n, 0)=0 (n>=1). - Paul D. Hanna, Mar 04 2005
G.f.: Sum_{n>0, k>0} x^n * y^(k*(k+1)/2) / Product_{i=1..k} (1 - y^i). - Michael Somos, Jul 11 2017
Sum_{k>=0} k! * Q(n,k) = A032020(n). - Alois P. Heinz, Feb 25 2020
Q(n, m) = A008284(n - m*(m-1)/2, m) = A026820(n - m*(m+1)/2, m), using for the latter, the extension A026820(n, k) = A026820(n, n) = A000041(n), for every k >= n >= 0. - Álvar Ibeas, Jul 23 2020

Extensions

Additional comments from Michael Somos, Dec 04 2002
Entry revised by N. J. A. Sloane, Nov 20 2006

A025147 Number of partitions of n into distinct parts >= 2.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 8, 10, 12, 15, 17, 21, 25, 29, 35, 41, 48, 56, 66, 76, 89, 103, 119, 137, 159, 181, 209, 239, 273, 312, 356, 404, 460, 522, 591, 669, 757, 853, 963, 1085, 1219, 1371, 1539, 1725, 1933, 2164, 2418, 2702, 3016, 3362, 3746, 4171, 4637, 5155
Offset: 0

Views

Author

Keywords

Comments

From R. J. Mathar, Jul 31 2008: (Start)
These "partitions of n into distinct parts >= k" and "partitions of n into distinct parts, the least being k-1" come in pairs of similar, almost shifted but not identical, sequences:
The distinction in the definitions is that "distinct parts >= k" sets a lower bound to all parts, whereas "the least being ..." means that the lower limit must be attained by one of the parts. (End)
From N. J. A. Sloane, Sep 28 2008: (Start)
Generating functions and Maple programs for the sequences in the first and second columns of the above list are respectively:
For A025147, A025148, etc.:
f:=proc(k) product(1+x^j, j=k..100): series(%,x,100): seriestolist(%); end;
For A096765, A096749, etc.:
g:=proc(k) x^(k-1)*product(1+x^j, j=k..100): series(%,x,100): seriestolist(%); end; (End)
Also number of partitions of n+1 into distinct parts, the least being 1.
Number of different sums from 1+[1,3]+[1,4]+...+[1,n]. - Jon Perry, Jan 01 2004
Also number of partitions of n such that if k is the largest part, then all parts from 1 to k occur, k occurring at least twice. Example: a(7)=3 because we have [2,2,2,1],[2,2,1,1,1] and [1,1,1,1,1,1,1]. - Emeric Deutsch, Apr 09 2006
Also number of partitions of n+1 such that if k is the largest part, then all parts from 1 to k occur, k occurring exactly once. Example: a(7)=3 because we have [3,2,2,1],[3,2,1,1,1] and [2,1,1,1,1,1,1] (there is a simple bijection with the partitions defined before). - Emeric Deutsch, Apr 09 2006
Also number of partitions of n+1 into distinct parts where the number of parts is itself a part. - Reinhard Zumkeller, Nov 04 2007
Partial sums give A038348 (observed by Jonathan Vos Post, proved by several correspondents).
Trivially, number of partitions of n into distinct parts (as ascending lists) such that the first part is not 1, the second not 2, the third not 3, etc., see example. - Joerg Arndt, Jun 10 2013
Convolution with A033999 gives A270144 (apart from the offset). - R. J. Mathar, Jun 18 2016

Examples

			a(7) = 3, from {{3, 4}, {2, 5}, {7}}
From _Joerg Arndt_, Jun 10 2013: (Start)
There are a(17) = 21 partitions of 17 into distinct parts >=2:
01:  [ 2 3 4 8 ]
02:  [ 2 3 5 7 ]
03:  [ 2 3 12 ]
04:  [ 2 4 5 6 ]
05:  [ 2 4 11 ]
06:  [ 2 5 10 ]
07:  [ 2 6 9 ]
08:  [ 2 7 8 ]
09:  [ 2 15 ]
10:  [ 3 4 10 ]
11:  [ 3 5 9 ]
12:  [ 3 6 8 ]
13:  [ 3 14 ]
14:  [ 4 5 8 ]
15:  [ 4 6 7 ]
16:  [ 4 13 ]
17:  [ 5 12 ]
18:  [ 6 11 ]
19:  [ 7 10 ]
20:  [ 8 9 ]
21:  [ 17 ]
(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.

Crossrefs

Programs

  • Haskell
    a025147 = p 2 where
       p _ 0 = 1
       p k m = if m < k then 0 else p (k + 1) (m - k) + p (k + 1) m
    -- Reinhard Zumkeller, Dec 28 2011
    
  • Maple
    g:=product(1+x^j,j=2..65): gser:=series(g,x=0,62): seq(coeff(gser,x,n),n=0..57); # Emeric Deutsch, Apr 09 2006
    with(combstruct):ZL := {L = PowerSet(Sequence(Z,card>=2)) },unlabeled:seq(count([L,ZL],size=i),i=0..57); # Zerinvary Lajos, Mar 09 2007
  • Mathematica
    CoefficientList[Series[Product[1+q^n, {n, 2, 60}], {q, 0, 60}], q]
    FoldList[ PartitionsQ[ #2+1 ]-#1&, 0, Range[ 64 ] ]
    (* also *)
    d[n_] := Select[IntegerPartitions[n], Max[Length /@ Split@#] == 1 && Min[#] >= 2 &]; Table[d[n], {n, 12}] (* strict partitions, parts >= 2 *)
    Table[Length[d[n]], {n, 40}] (* A025147 for n >= 1 *)
    (* Clark Kimberling, Mar 07 2014 *)
    p[, 0] = 1; p[k, m_] := p[k, m] = If[m < k, 0, p[k+1, m-k] + p[k+1, m]]; Table[p[2, m], {m, 0, 59}] (* Jean-François Alcover, Apr 17 2014, after Reinhard Zumkeller *)
  • PARI
    a(n)=if(n,my(v=partitions(n));sum(i=1,#v,v[i][1]>1&&v[i]==vecsort(v[i],,8)),1) \\ Charles R Greathouse IV, Nov 20 2012

Formula

G.f.: Product_{k>=2} (1+x^k).
a(n) = A000009(n)-a(n-1) = Sum_{0<=k<=n} (-1)^k*A000009(n-k). - Henry Bottomley, May 09 2002
a(n)=t(n, 1), where t(n, k)=1+Sum_{i>j>k and i+j=n} t(i, j), 2<=k<=n. - Reinhard Zumkeller, Jan 01 2003
G.f.: 1 + Sum_{k=1..infinity} (x^(k*(k+3)/2) / Product_{j=1..k} (1-x^j)). - Emeric Deutsch, Apr 09 2006
The previous g.f. is a special case of the g.f. for partitions into distinct parts >= L, Sum_{n>=0} ( x^(n*(n+2*L-1)/2) / Product_{k=1..n} (1-x^k) ). - Joerg Arndt, Mar 24 2011
G.f.: Sum_{n>=1} ( x^(n*(n+1)/2-1) / Product_{k=1..n-1} (1-x^k) ), a special case of the g.f. for partitions into distinct parts >= L, Sum_{n>=L-1} ( x^(n*(n+1)/2-L*(L-1)/2) / Product_{k=1..n-(L-1)} (1-x^k) ). - Joerg Arndt, Mar 27 2011
a(n) = Sum_{1A060016(n-k+1,k-1), for n>0. - Reinhard Zumkeller, Nov 04 2007
a(n) = A096765(n+1). - R. J. Mathar, Jul 31 2008
From Vaclav Kotesovec, Aug 16 2015: (Start)
a(n) ~ 1/2 * A000009(n).
a(n) ~ exp(Pi*sqrt(n/3)) / (8*3^(1/4)*n^(3/4)).
(End)

Extensions

Corrected and extended by Dean Hickerson, Oct 10 2001

A072574 Triangle T(n,k) of number of compositions (ordered partitions) of n into exactly k distinct parts, 1<=k<=n.

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 1, 2, 0, 0, 1, 4, 0, 0, 0, 1, 4, 6, 0, 0, 0, 1, 6, 6, 0, 0, 0, 0, 1, 6, 12, 0, 0, 0, 0, 0, 1, 8, 18, 0, 0, 0, 0, 0, 0, 1, 8, 24, 24, 0, 0, 0, 0, 0, 0, 1, 10, 30, 24, 0, 0, 0, 0, 0, 0, 0, 1, 10, 42, 48, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 48, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 60, 120, 0
Offset: 1

Views

Author

Henry Bottomley, Jun 21 2002

Keywords

Comments

If terms in the compositions did not need to be distinct then the triangle would have values C(n-1,k-1), essentially A007318 offset.

Examples

			T(6,2)=4 since 6 can be written as 1+5=2+4=4+2=5+1.
Triangle starts (trailing zeros omitted for n>=10):
[ 1]  1;
[ 2]  1, 0;
[ 3]  1, 2, 0;
[ 4]  1, 2, 0, 0;
[ 5]  1, 4, 0, 0, 0;
[ 6]  1, 4, 6, 0, 0, 0;
[ 7]  1, 6, 6, 0, 0, 0, 0;
[ 8]  1, 6, 12, 0, 0, 0, 0, 0;
[ 9]  1, 8, 18, 0, 0, 0, 0, 0, 0;
[10]  1, 8, 24, 24, 0, 0, ...;
[11]  1, 10, 30, 24, 0, 0, ...;
[12]  1, 10, 42, 48, 0, 0, ...;
[13]  1, 12, 48, 72, 0, 0, ...;
[14]  1, 12, 60, 120, 0, 0, ...;
[15]  1, 14, 72, 144, 120, 0, 0, ...;
[16]  1, 14, 84, 216, 120, 0, 0, ...;
[17]  1, 16, 96, 264, 240, 0, 0, ...;
[18]  1, 16, 114, 360, 360, 0, 0, ...;
[19]  1, 18, 126, 432, 600, 0, 0, ...;
[20]  1, 18, 144, 552, 840, 0, 0, ...;
These rows (without the zeros) are shown in the Richmond/Knopfmacher reference.
From _Gus Wiseman_, Oct 17 2022: (Start)
Column n = 8 counts the following compositions.
  (8)  (1,7)  (1,2,5)
       (2,6)  (1,3,4)
       (3,5)  (1,4,3)
       (5,3)  (1,5,2)
       (6,2)  (2,1,5)
       (7,1)  (2,5,1)
              (3,1,4)
              (3,4,1)
              (4,1,3)
              (4,3,1)
              (5,1,2)
              (5,2,1)
(End)
		

Crossrefs

Columns (offset) include A057427 and A052928.
Row sums are A032020.
A008289 is the version for partitions (zeros removed).
A072575 counts strict compositions by maximum.
A097805 is the non-strict version, or A007318 (zeros removed).
A113704 is the constant instead of strict version.
A216652 is a condensed version (zeros removed).
A336131 counts splittings of partitions with distinct sums.
A336139 counts strict compositions of each part of a strict composition.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&],Length[#]==k&]],{n,0,15},{k,1,n}] (* Gus Wiseman, Oct 17 2022 *)
  • PARI
    N=21;  q='q+O('q^N);
    gf=sum(n=0,N, n! * z^n * q^((n^2+n)/2) / prod(k=1,n, 1-q^k ) );
    /* print triangle: */
    gf -= 1; /* remove row zero */
    P=Pol(gf,'q);
    { for (n=1,N-1,
        p = Pol(polcoeff(P, n),'z);
        p += 'z^(n+1);  /* preserve trailing zeros */
        v = Vec(polrecip(p));
        v = vector(n,k,v[k]); /* trim to size n */
        print(v);
    ); }
    /* Joerg Arndt, Oct 20 2012 */

Formula

T(n, k) = T(n-k, k)+k*T(n-k, k-1) [with T(n, 0)=1 if n=0 and 0 otherwise] = A000142(k)*A060016(n, k).
G.f.: sum(n>=0, n! * z^n * q^((n^2+n)/2) / prod(k=1..n, 1-q^k ) ), rows by powers of q, columns by powers of z; includes row 0 (drop term for n=0 for this triangle, see PARI code); setting z=1 gives g.f. for A032020. [Joerg Arndt, Oct 20 2012]

A360071 Regular tetrangle where T(n,k,i) = number of integer partitions of n of length k with i distinct parts.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jan 28 2023

Keywords

Comments

I call this a tetrangle because it is a sequence of finite triangles. - Gus Wiseman, Jan 30 2023

Examples

			Tetrangle begins:
  1   1     1       1         1           1             1
      1 0   0 1     1 1       0 2         1 2           0 3
            1 0 0   0 1 0     0 2 0       1 1 1         0 3 1
                    1 0 0 0   0 1 0 0     0 2 0 0       0 2 1 0
                              1 0 0 0 0   0 1 0 0 0     0 2 0 0 0
                                          1 0 0 0 0 0   0 1 0 0 0 0
                                                        1 0 0 0 0 0 0
For example, finite triangle n = 5 counts the following partitions:
    (5)
     .    (41)(32)
     .   (311)(221)  .
     .     (2111)    .   .
  (11111)     .      .   .   .
		

Crossrefs

Row sums are A008284 (partitions by number of parts), reverse A058398.
First columns i = 1 are A051731.
Last columns i = k are A060016.
Column sums are A116608 (partitions by number of distinct parts).
Positive terms are counted by A360072.
A000041 counts partitions, strict A000009.
Other tetrangles: A318393, A318816, A320808, A334433, A345197.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], Length[#]==k&&Length[Union[#]]==i&]],{n,1,9},{k,1,n},{i,1,k}]

A072707 Number of non-unimodal compositions of n into distinct terms.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 24, 26, 46, 64, 100, 224, 276, 416, 590, 850, 1144, 2214, 2644, 3938, 5282, 7504, 9776, 13704, 21984, 27632, 38426, 51562, 69844, 91950, 123504, 159658, 246830, 303400, 416068, 540480, 730268, 933176, 1248110
Offset: 0

Views

Author

Henry Bottomley, Jul 04 2002

Keywords

Comments

Also the number of compositions of n into distinct terms whose negation is not unimodal. - Gus Wiseman, Mar 05 2020

Examples

			a(6)=2 since 6 can be written as 2+1+3 or 3+1+2.
From _Gus Wiseman_, Mar 05 2020: (Start)
The a(6) = 2 through a(9) = 6 strict compositions:
  (2,1,3)  (2,1,4)  (2,1,5)  (2,1,6)
  (3,1,2)  (4,1,2)  (3,1,4)  (3,1,5)
                    (4,1,3)  (3,2,4)
                    (5,1,2)  (4,2,3)
                             (5,1,3)
                             (6,1,2)
(End)
		

Crossrefs

The complement is counted by A072706.
The non-strict version is A115981.
The case where the negation is not unimodal either is A332874.
Unimodal compositions are A001523.
Strict compositions are A032020.
Non-unimodal permutations are A059204.
A triangle for strict unimodal compositions is A072705.
Non-unimodal sequences covering an initial interval are A328509.
Numbers whose prime signature is not unimodal are A332282.
Strict partitions whose 0-appended differences are not unimodal are A332286.
Compositions whose negation is unimodal are A332578.
Compositions whose negation is not unimodal are A332669.
Non-unimodal compositions covering an initial interval are A332743.

Programs

  • Mathematica
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@#&&!unimodQ[#]&]],{n,0,16}] (* Gus Wiseman, Mar 05 2020 *)

Formula

a(n) = A032020(n) - A072706(n) = Sum_{k} A059204(k) * A060016(n, k).

A330460 Triangle read by rows where T(n,k) is the number of set partitions with k blocks and total sum n.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 0, 3, 2, 0, 0, 0, 0, 4, 5, 1, 0, 0, 0, 0, 5, 6, 1, 0, 0, 0, 0, 0, 6, 9, 2, 0, 0, 0, 0, 0, 0, 8, 13, 3, 0, 0, 0, 0, 0, 0, 0, 10, 23, 10, 1, 0, 0, 0, 0, 0, 0, 0, 12, 27, 11, 1, 0, 0, 0, 0, 0, 0, 0, 0, 15, 40, 19, 2, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Gus Wiseman, Dec 18 2019

Keywords

Examples

			Triangle begins:
  1
  0  1
  0  1  0
  0  2  1  0
  0  2  1  0  0
  0  3  2  0  0  0
  0  4  5  1  0  0  0
  0  5  6  1  0  0  0  0
  0  6  9  2  0  0  0  0  0
  0  8 13  3  0  0  0  0  0  0
  0 10 23 10  1  0  0  0  0  0  0
  0 12 27 11  1  0  0  0  0  0  0  0
  0 15 40 19  2  0  0  0  0  0  0  0  0
Row n = 8 counts the following set partitions:
  {{8}}      {{1},{7}}    {{1},{2},{5}}
  {{3,5}}    {{2},{6}}    {{1},{3},{4}}
  {{2,6}}    {{3},{5}}
  {{1,7}}    {{1},{3,4}}
  {{1,3,4}}  {{1},{2,5}}
  {{1,2,5}}  {{2},{1,5}}
             {{3},{1,4}}
             {{4},{1,3}}
             {{5},{1,2}}
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(i*(i+1)/2 k*
             b(n-i, t, k)+b(n-i, t, k+1))(min(n-i, i-1))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2, 0)):
    seq(T(n), n=0..15);  # Alois P. Heinz, Dec 29 2019
  • Mathematica
    ppl[n_,k_]:=Switch[k,0,{n},1,IntegerPartitions[n],_,Join@@Table[Union[Sort/@Tuples[ppl[#,k-1]&/@ptn]],{ptn,IntegerPartitions[n]}]];
    Table[Length[Select[ppl[n,2],Length[#]==k&&And[UnsameQ@@#,UnsameQ@@Join@@#]&]],{n,0,10},{k,0,n}]
    (* Second program: *)
    b[n_, i_, k_] := b[n, i, k] = If[i(i+1)/2 < n, 0, If[n == 0, x^k, b[n, i-1, k] + Function[t, k*b[n-i, t, k] + b[n-i, t, k + 1]][Min[n-i, i-1]]]];
    T[n_] := PadRight[CoefficientList[b[n, n, 0], x], n + 1];
    T /@ Range[0, 15] // Flatten (* Jean-François Alcover, May 16 2021, after Alois P. Heinz *)
  • PARI
    A(n)={my(v=Vec(prod(k=1, n, 1 + x^k*y + O(x*x^n)))); vector(#v, n, my(p=v[n]); vector(n, k, sum(i=k, n, polcoef(p,i-1)*stirling(i-1, k-1, 2))))}
    {my(T=A(12)); for(n=1, #T, print(T[n]))} \\ Andrew Howroyd, Dec 29 2019

Formula

T(n,k) = Sum_{k <= i <= n} A060016(n,i) * A008277(i,k).
For n > 0, T(n,2) = Sum_{k = 1..n} (2^(k - 1) -1) * A060016(n,k).

A330463 Triangle read by rows where T(n,k) is the number of k-element sets of nonempty multisets of positive integers with total sum n.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 0, 3, 2, 0, 0, 5, 4, 0, 0, 0, 7, 11, 1, 0, 0, 0, 11, 20, 6, 0, 0, 0, 0, 15, 40, 16, 0, 0, 0, 0, 0, 22, 68, 40, 3, 0, 0, 0, 0, 0, 30, 120, 91, 11, 0, 0, 0, 0, 0, 0, 42, 195, 186, 41, 0, 0, 0, 0, 0, 0, 0, 56, 320, 367, 105, 3, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Gus Wiseman, Dec 19 2019

Keywords

Examples

			Triangle begins:
  1
  0  1
  0  2  0
  0  3  2  0
  0  5  4  0  0
  0  7 11  1  0  0
  0 11 20  6  0  0  0
  0 15 40 16  0  0  0  0
  0 22 68 40  3  0  0  0  0
  ...
Row n = 5 counts the following sets of multisets:
  {{5}}          {{1},{4}}        {{1},{2},{1,1}}
  {{1,4}}        {{2},{3}}
  {{2,3}}        {{1},{1,3}}
  {{1,1,3}}      {{1},{2,2}}
  {{1,2,2}}      {{2},{1,2}}
  {{1,1,1,2}}    {{3},{1,1}}
  {{1,1,1,1,1}}  {{1},{1,1,2}}
                 {{1,1},{1,2}}
                 {{2},{1,1,1}}
                 {{1},{1,1,1,1}}
                 {{1,1},{1,1,1}}
		

Crossrefs

Row sums are A261049.
Column k = 1 is A000041.
Multisets of multisets are A061260, with row sums A001970.
Sets of sets are A330462, with row sums A050342.
Multisets of sets are A285229, with row sums A089259.
Sets of disjoint sets are A330460, with row sums A294617.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, add(binomial(
           combinat[numbpart](i), j)*expand(b(n-i*j, i-1)*x^j), j=0..n/i)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2)):
    seq(T(n), n=0..14);  # Alois P. Heinz, Dec 30 2019
  • Mathematica
    ppl[n_,k_]:=Switch[k,0,{n},1,IntegerPartitions[n],_,Join@@Table[Union[Sort/@Tuples[ppl[#,k-1]&/@ptn]],{ptn,IntegerPartitions[n]}]];
    Table[Length[Select[ppl[n,2],And[UnsameQ@@#,Length[#]==k]&]],{n,0,10},{k,0,n}]
    (* Second program: *)
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i<1, 0, Sum[Binomial[
         PartitionsP[i], j]*Expand[b[n - i*j, i - 1]*x^j], {j, 0, n/i}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n}]][b[n, n]];
    T /@ Range[0, 14] // Flatten (* Jean-François Alcover, May 18 2021, after Alois P. Heinz *)
  • PARI
    A(n)={my(v=Vec(prod(k=1, n, (1 + x^k*y + O(x*x^n))^numbpart(k)))); vector(#v, n, Vecrev(v[n],n))}
    {my(T=A(12)); for(n=1, #T, print(T[n]))} \\ Andrew Howroyd, Dec 29 2019

Formula

G.f.: Product_{j>=1} (1 + y*x^j)^A000041(j). - Andrew Howroyd, Dec 29 2019

A026835 Triangular array read by rows: T(n,k) = number of partitions of n into distinct parts in which every part is >=k, for k=1,2,...,n.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 4, 2, 1, 1, 1, 1, 5, 3, 2, 1, 1, 1, 1, 6, 3, 2, 1, 1, 1, 1, 1, 8, 5, 3, 2, 1, 1, 1, 1, 1, 10, 5, 3, 2, 1, 1, 1, 1, 1, 1, 12, 7, 4, 3, 2, 1, 1, 1, 1, 1, 1, 15, 8, 5, 3, 2, 1, 1, 1, 1, 1, 1, 1, 18, 10, 6, 4, 3, 2, 1, 1, 1, 1, 1, 1, 1, 22, 12, 7, 4, 3, 2, 1, 1
Offset: 1

Views

Author

Keywords

Comments

T(n,1)=A000009(n), T(n,2)=A025147(n) for n>1, T(n,3)=A025148(n) for n>2, T(n,4)=A025149(n) for n>3.
A219922(n) = smallest number of row containing n. - Reinhard Zumkeller, Dec 01 2012

Examples

			From _Michael De Vlieger_, Aug 03 2020: (Start)
Table begins:
   1
   1   1
   2   1   1
   2   1   1   1
   3   2   1   1   1
   4   2   1   1   1   1
   5   3   2   1   1   1   1
   6   3   2   1   1   1   1   1
   8   5   3   2   1   1   1   1   1
  10   5   3   2   1   1   1   1   1   1
  12   7   4   3   2   1   1   1   1   1   1
  15   8   5   3   2   1   1   1   1   1   1   1
  ... (End)
		

Crossrefs

Programs

  • Haskell
    import Data.List (tails)
    a026835 n k = a026835_tabl !! (n-1) !! (k-1)
    a026835_row n = a026835_tabl !! (n-1)
    a026835_tabl = map
       (\row -> map (p $ last row) $ init $ tails row) a002260_tabl
       where p 0      _ = 1
             p _     [] = 0
             p m (k:ks) = if m < k then 0 else p (m - k) ks + p m ks
    -- Reinhard Zumkeller, Dec 01 2012
  • Mathematica
    Nest[Function[{T, n, r}, Append[T, Table[1 + Total[T[[##]] & @@@ Select[r, #[[-1]] > k + 1 &]], {k, 0, n}]]] @@ {#1, #2, Transpose[1 + {#2 - #3, #3}]} & @@ {#1, #2, Range[Ceiling[#2/2] - 1]} & @@ {#, Length@ #} &, {{1}}, 12] // Flatten (* Michael De Vlieger, Aug 03 2020 *)

Formula

G.f.: Sum_{k>=1} (y^k*(-1+Product_{i>=k} (1+x^i))). - Vladeta Jovovic, Aug 25 2003
T(n, k) = 1 + Sum(T(i, j): i>=j>k and i+j=n+1). - Reinhard Zumkeller, Jan 01 2003
T(n, k) > 1 iff 2*k < n. - Reinhard Zumkeller, Jan 01 2003
Showing 1-10 of 17 results. Next