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-3 of 3 results.

A364910 Number of integer partitions of 2n whose distinct parts sum to n.

Original entry on oeis.org

1, 1, 1, 3, 3, 4, 12, 11, 19, 23, 54, 55, 103, 115, 178, 289, 389, 507, 757, 970, 1343, 2033, 2579, 3481, 4840, 6312, 8317, 10998, 15459, 19334, 26368, 33480, 44709, 56838, 74878, 93369, 128109, 157024, 206471, 258357, 338085, 417530, 544263, 669388, 859570, 1082758, 1367068
Offset: 0

Views

Author

Gus Wiseman, Aug 16 2023

Keywords

Comments

Also the number of ways to write n as a nonnegative linear combination of the parts of a strict integer partition of n.

Examples

			The a(0) = 1 through a(7) = 11 partitions:
  ()  (11)  (22)  (33)     (44)      (55)       (66)         (77)
                  (2211)   (3311)    (3322)     (4422)       (4433)
                  (21111)  (311111)  (4411)     (5511)       (5522)
                                     (4111111)  (33321)      (6611)
                                                (42222)      (442211)
                                                (322221)     (4222211)
                                                (332211)     (4421111)
                                                (3222111)    (42221111)
                                                (3321111)    (422111111)
                                                (32211111)   (611111111)
                                                (51111111)   (4211111111)
                                                (321111111)
The a(0) = 1 through a(7) = 11 linear combinations:
  0  1*1  1*2  1*3      1*4      1*5      1*6          1*7
               0*2+3*1  0*3+4*1  0*4+5*1  0*4+3*2      0*6+7*1
               1*2+1*1  1*3+1*1  1*3+1*2  0*5+6*1      1*4+1*3
                                 1*4+1*1  1*4+1*2      1*5+1*2
                                          1*5+1*1      1*6+1*1
                                          0*3+0*2+6*1  0*4+0*2+7*1
                                          0*3+1*2+4*1  0*4+1*2+5*1
                                          0*3+2*2+2*1  0*4+2*2+3*1
                                          0*3+3*2+0*1  0*4+3*2+1*1
                                          1*3+0*2+3*1  1*4+0*2+3*1
                                          1*3+1*2+1*1  1*4+1*2+1*1
                                          2*3+0*2+0*1
		

Crossrefs

The case with no zero coefficients is A000009.
Central diagonal of A116861.
A version based on Heinz numbers is A364906.
Using all partitions (not just strict) we get A364907.
The version for compositions is A364908, strict A364909.
Main diagonal of A364916.
Using strict partitions of any number from 1 to n gives A365002.
These partitions have ranks A365003.
A000041 counts integer partitions, strict A000009.
A008284 counts partitions by length, strict A008289.
A323092 counts double-free partitions, ranks A320340.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[2n],Total[Union[#]]==n&]],{n,0,15}]
  • PARI
    a(n) = {my(res = 0); forpart(p = 2*n,s = Set(p); if(vecsum(s) == n, res++)); res} \\ David A. Corneth, Aug 20 2023
    
  • Python
    from sympy.utilities.iterables import partitions
    def A364910(n): return sum(1 for d in partitions(n<<1,k=n) if sum(set(d))==n) # Chai Wah Wu, Sep 13 2023

Formula

a(n) = A116861(2n,n).
a(n) = A364916(n,n).

Extensions

More terms from David A. Corneth, Aug 20 2023

A364907 Number of ways to write n as a nonnegative linear combination of an integer partition of n.

Original entry on oeis.org

1, 1, 4, 13, 50, 179, 696, 2619, 10119, 38867, 150407, 582065, 2260367, 8786919, 34225256, 133471650, 521216494, 2037608462, 7974105052, 31235316275, 122457794193, 480473181271, 1886555402750, 7412471695859, 29142658077266, 114643347181003, 451237737215201
Offset: 0

Views

Author

Gus Wiseman, Aug 18 2023

Keywords

Comments

A way of writing n as a (presumed nonnegative) linear combination of a finite sequence y is any sequence of pairs (k_i,y_i) such that k_i >= 0 and Sum k_i*y_i = n. For example, the pairs ((3,1),(1,1),(1,1),(0,2)) are a way of writing 5 as a linear combination of (1,1,1,2), namely 5 = 3*1 + 1*1 + 1*1 + 0*2. Of course, there are A000041(n) ways to write n as a linear combination of (1..n).

Examples

			The a(0) = 1 through a(3) = 13 ways:
  0  1*1  1*2      1*3
          0*1+2*1  0*2+3*1
          1*1+1*1  1*2+1*1
          2*1+0*1  0*1+0*1+3*1
                   0*1+1*1+2*1
                   0*1+2*1+1*1
                   0*1+3*1+0*1
                   1*1+0*1+2*1
                   1*1+1*1+1*1
                   1*1+2*1+0*1
                   2*1+0*1+1*1
                   2*1+1*1+0*1
                   3*1+0*1+0*1
		

Crossrefs

The case with no zero coefficients is A000041.
A finer version is A364906.
The version for compositions is A364908, strict A364909.
Using just strict partitions we get A364910, main diagonal of A364916.
Main diagonal of A365004.
A000041 counts integer partitions, strict A000009.
A008284 counts partitions by length, strict A008289.
A323092 counts double-free partitions, ranks A320340.

Programs

  • Maple
    b:= proc(n, i, m) option remember; `if`(n=0, `if`(m=0, 1, 0),
         `if`(i<1, 0, b(n, i-1, m)+add(b(n-i, min(i, n-i), m-i*j), j=0..m/i)))
        end:
    a:= n-> b(n$3):
    seq(a(n), n=0..27);  # Alois P. Heinz, Jan 28 2024
  • Mathematica
    combs[n_,y_]:=With[{s=Table[{k,i},{k,y},{i,0,Floor[n/k]}]},Select[Tuples[s],Total[Times@@@#]==n&]];
    Table[Length[Join@@Table[combs[n,ptn],{ptn,IntegerPartitions[n]}]],{n,0,5}]

Formula

a(n) = Sum_{m:A056239(m)=n} A364906(m).
a(n) = A364912(2n,n).
a(n) = A365004(n,n).

Extensions

a(9)-a(26) from Alois P. Heinz, Jan 28 2024

A364908 Number of ways to write n as a nonnegative linear combination of an integer composition of n.

Original entry on oeis.org

1, 1, 4, 15, 70, 314, 1542, 7428, 36860, 182911, 917188, 4612480, 23323662, 118273428, 601762636, 3069070533, 15689123386, 80356953555, 412300910566, 2118715503962, 10902791722490, 56175374185014, 289766946825180, 1496239506613985, 7733302967423382
Offset: 0

Views

Author

Gus Wiseman, Aug 22 2023

Keywords

Comments

A way of writing n as a (nonnegative) linear combination of a finite sequence y is any sequence of pairs (k_i,y_i) such that k_i >= 0 and Sum k_i*y_i = n. For example, the pairs ((3,1),(1,1),(1,1),(0,2)) are a way of writing 5 as a linear combination of (1,1,1,2), namely 5 = 3*1 + 1*1 + 1*1 + 0*2. Of course, there are A000041(n) ways to write n as a linear combination of (1..n).

Examples

			The a(3) = 15 ways to write 3 as a nonnegative linear combination of an integer composition of 3:
  1*3  0*2+3*1  1*1+1*2  0*1+0*1+3*1
       1*2+1*1  3*1+0*2  0*1+1*1+2*1
                         0*1+2*1+1*1
                         0*1+3*1+0*1
                         1*1+0*1+2*1
                         1*1+1*1+1*1
                         1*1+2*1+0*1
                         2*1+0*1+1*1
                         2*1+1*1+0*1
                         3*1+0*1+0*1
		

Crossrefs

The case with no zero coefficients is A011782.
The version for partitions is A364907, strict A364910.
The strict case is A364909.
A000041 counts integer partitions, strict A000009.
A011782 counts compositions, strict A032020.
A097805 counts compositions by length, strict A072574.
A116861 = positive linear combinations of strict ptns of k, reverse A364916.
A365067 = nonnegative linear combinations of strict partitions of k.
A364912 = positive linear combinations of partitions of k.
A364916 = positive linear combinations of strict partitions of k.

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, `if`(m=0, 1, 0),
          add(add(b(n-i, m-i*j), j=0..m/i), i=1..n))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 28 2024
  • Mathematica
    combs[n_,y_]:=With[{s=Table[{k,i},{k,y},{i,0,Floor[n/k]}]}, Select[Tuples[s],Total[Times@@@#]==n&]];
    Table[Length[Join@@Table[combs[n,ptn],{ptn,Join@@Permutations /@ IntegerPartitions[n]}]],{n,0,5}]

Extensions

a(8)-a(24) from Alois P. Heinz, Jan 28 2024
Showing 1-3 of 3 results.