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-5 of 5 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

A364909 Number of ways to write n as a nonnegative linear combination of a strict integer composition of n.

Original entry on oeis.org

1, 1, 1, 5, 5, 7, 51, 45, 89, 109, 709, 733, 1495, 1935, 3119, 13785, 16611, 29035, 44611, 68733, 95193, 372897, 435007, 781345, 1177181, 1866659, 2600537, 3906561, 12052631, 14610799, 25407653, 37652265, 59943351, 84060993, 128112805, 172172117, 480353257, 578740011
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(5) = 7 ways:
  .  1*1  1*2  1*3      1*4      1*5
               0*2+3*1  0*3+4*1  0*4+5*1
               1*1+1*2  1*1+1*3  1*1+1*4
               1*2+1*1  1*3+1*1  1*2+1*3
               3*1+0*2  4*1+0*3  1*3+1*2
                                 1*4+1*1
                                 5*1+0*4
		

Crossrefs

The case with no zero coefficients is A032020.
The version for partitions is A364907, strict A364910(n) = A364916(n,n).
The non-strict version is A364908.
A000041 counts integer partitions, strict A000009.
A011782 counts compositions, strict A032020.
A008284 counts partitions by length, strict A008289.
A097805 counts compositions by length, strict A072574.

Programs

  • 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/@Select[IntegerPartitions[n],UnsameQ@@#&]}]],{n,0,5}]
  • Python
    from math import factorial
    from sympy.utilities.iterables import partitions
    def A364909(n):
        if n == 0: return 1
        aset = tuple(set(p) for p in partitions(n) if max(p.values(),default=0)==1)
        return sum(factorial(len(t)) for p in partitions(n) for t in aset if set(p).issubset(t)) # Chai Wah Wu, Sep 21 2023

Extensions

a(18)-a(37) from Chai Wah Wu, Sep 21 2023

A365003 Heinz numbers of integer partitions where the sum of all parts is twice the sum of distinct parts.

Original entry on oeis.org

1, 4, 9, 25, 36, 48, 49, 100, 121, 160, 169, 196, 225, 289, 361, 441, 448, 484, 529, 567, 676, 750, 810, 841, 900, 961, 1080, 1089, 1156, 1200, 1225, 1369, 1408, 1440, 1444, 1521, 1681, 1764, 1849, 1920, 2116, 2209, 2268, 2352, 2601, 2809, 3024, 3025, 3159
Offset: 1

Views

Author

Gus Wiseman, Aug 23 2023

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.

Examples

			The prime indices of 750 are {1,2,3,3,3}, with sum 12, while the distinct prime indices {1,2,3} have sum 6, so 750 is in the sequence.
The terms together with their prime indices begin:
     1: {}
     4: {1,1}
     9: {2,2}
    25: {3,3}
    36: {1,1,2,2}
    48: {1,1,1,1,2}
    49: {4,4}
   100: {1,1,3,3}
   121: {5,5}
   160: {1,1,1,1,1,3}
   169: {6,6}
   196: {1,1,4,4}
   225: {2,2,3,3}
   289: {7,7}
   361: {8,8}
   441: {2,2,4,4}
   448: {1,1,1,1,1,1,4}
		

Crossrefs

The LHS is A056239 (sum of prime indices).
The RHS is twice A066328.
Partitions of this type are counted by A364910.
A000041 counts integer partitions, strict A000009.
A001222 counts prime indices, distinct A001221.
A112798 lists prime indices, distinct A304038.
A116861 counts partitions by sum and sum of distinct parts.
A323092 counts double-free partitions, ranks A320340.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[1000],Total[prix[#]]==2*Total[Union[prix[#]]]&]

Formula

A056239(a(n)) = 2*A066328(a(n)).
Showing 1-5 of 5 results.