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.

Previous Showing 11-20 of 24 results. Next

A371797 Number of quanimous subsets of {1..n} containing n, meaning there is more than one set partition with equal block-sums.

Original entry on oeis.org

0, 0, 1, 2, 5, 11, 24, 51, 112, 233, 507, 1044, 2214, 4557, 9472, 19545, 40373, 82145, 168374, 341523, 693350, 1408893, 2860365, 5771355, 11667351, 23542022, 47484577, 95861243, 193447849, 389602553
Offset: 1

Views

Author

Gus Wiseman, Apr 17 2024

Keywords

Comments

A finite multiset of numbers is defined to be quanimous iff it can be partitioned into two or more multisets with equal sums. Quanimous partitions are counted by A321452 and ranked by A321454.

Examples

			The set s = {3,4,6,8,9} has set partitions {{3,4,6,8,9}} and {{3,4,8},{6,9}} with equal block-sums, so s is counted under a(9).
The a(1) = 0 through a(6) = 11 subsets:
  .  .  {1,2,3}  {1,3,4}    {1,4,5}      {1,5,6}
                 {1,2,3,4}  {2,3,5}      {2,4,6}
                            {1,2,4,5}    {1,2,3,6}
                            {2,3,4,5}    {1,2,5,6}
                            {1,2,3,4,5}  {1,3,4,6}
                                         {2,3,5,6}
                                         {3,4,5,6}
                                         {1,2,3,4,6}
                                         {1,2,4,5,6}
                                         {2,3,4,5,6}
                                         {1,2,3,4,5,6}
		

Crossrefs

The "bi-" version is A232466, complement A371793.
The complement is counted by A371790.
First differences of A371796, complement A371789.
A371736 counts non-quanimous strict partitions.
A371737 counts quanimous strict partitions.
A371783 counts k-quanimous partitions.
A371791 counts biquanimous subsets, complement A371792.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[Subsets[Range[n]], MemberQ[#,n]&&Length[Select[sps[#],SameQ@@Total/@#&]]>1&]],{n,10}]

Extensions

a(11)-a(30) from Martin Fuller, Apr 01 2025

A371782 Numbers with non-biquanimous prime signature.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 16, 17, 18, 19, 20, 23, 24, 25, 27, 28, 29, 30, 31, 32, 37, 40, 41, 42, 43, 44, 45, 47, 48, 49, 50, 52, 53, 54, 56, 59, 61, 63, 64, 66, 67, 68, 70, 71, 72, 73, 75, 76, 78, 79, 80, 81, 83, 88, 89, 92, 96, 97, 98, 99, 101, 102
Offset: 1

Views

Author

Gus Wiseman, Apr 09 2024

Keywords

Comments

A finite multiset of numbers is defined to be biquanimous iff it can be partitioned into two multisets with equal sums. Biquanimous partitions are counted by A002219 (aerated) and ranked by A357976.
Also numbers n without a unitary divisor d|n having exactly half as many prime factors as n, counting multiplicity.

Examples

			The prime signature of 120 is (3,1,1), which is not biquanimous, so 120 is in the sequence.
		

Crossrefs

A number's prime signature is given by A124010.
The complement for prime indices is A357976, counted by A002219 aerated.
For prime indices we have A371731, counted by A371795, even case A006827.
The complement is A371781, counted by A371839.
Partitions of this type are counted by A371840.
A112798 lists prime indices, reverse A296150, length A001222, sum A056239.
A237258 (aerated) counts biquanimous strict partitions, ranks A357854.
A321142 and A371794 count non-biquanimous strict partitions.
A321451 counts non-quanimous partitions, ranks A321453.
A321452 counts quanimous partitions, ranks A321454.
A371792 counts non-biquanimous sets, complement A371791.
Subsequence of A026424.

Programs

  • Mathematica
    g[n_]:=Select[Divisors[n],GCD[#,n/#]==1&&PrimeOmega[#]==PrimeOmega[n/#]&];
    Select[Range[100],g[#]=={}&]
    (* second program: *)
    q[n_] := Module[{e = FactorInteger[n][[;; , 2]], sum, x}, sum = Plus @@ e; OddQ[sum] || CoefficientList[Product[1 + x^i, {i, e}], x][[1 + sum/2]] == 0]; q[1] = False; Select[Range[120], q] (* Amiram Eldar, Jul 24 2024 *)

A371790 Number of non-quanimous subsets of {1..n} containing n, meaning there is only one set partition with equal block-sums.

Original entry on oeis.org

1, 2, 3, 6, 11, 21, 40, 77, 144, 279, 517, 1004, 1882, 3635, 6912, 13223, 25163, 48927, 93770, 182765, 355226, 688259, 1333939, 2617253, 5109865, 10012410, 19624287, 38356485, 74987607, 147268359
Offset: 1

Views

Author

Gus Wiseman, Apr 17 2024

Keywords

Examples

			The set s = {3,4,6,8,9} has set partitions {{3,4,6,8,9}} and {{3,4,8},{6,9}} with equal block-sums, so s is not counted under a(9).
The a(1) = 1 through a(5) = 11 subsets:
  {1}  {2}    {3}    {4}      {5}
       {1,2}  {1,3}  {1,4}    {1,5}
              {2,3}  {2,4}    {2,5}
                     {3,4}    {3,5}
                     {1,2,4}  {4,5}
                     {2,3,4}  {1,2,5}
                              {1,3,5}
                              {2,4,5}
                              {3,4,5}
                              {1,2,3,5}
                              {1,3,4,5}
		

Crossrefs

First differences of A371789, complement counted by A371796.
The "bi-" version is A371793, complement A232466.
The complement is counted by A371797.
A371736 counts non-quanimous strict partitions.
A371737 counts quanimous strict partitions.
A371783 counts k-quanimous partitions.
A371791 counts biquanimous subsets, complement A371792.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[Subsets[Range[n]], MemberQ[#,n]&&Length[Select[sps[#],SameQ@@Total/@#&]]==1&]],{n,10}]

Extensions

a(11)-a(30) from Martin Fuller, Apr 01 2025

A371736 Number of non-quanimous strict integer partitions of n, meaning no set partition with more than one block has all equal block-sums.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 5, 5, 8, 7, 12, 11, 18, 15, 26, 23, 38, 30, 54, 43, 72, 57, 104, 77, 142, 102, 179, 138, 256, 170, 340, 232, 412, 292, 585, 365, 760, 471, 889, 602, 1260, 718, 1610, 935, 1819, 1148, 2590, 1371, 3264, 1733, 3581, 2137, 5120, 2485, 6372
Offset: 0

Views

Author

Gus Wiseman, Apr 14 2024

Keywords

Comments

A finite multiset of numbers is defined to be quanimous iff it can be partitioned into two or more multisets with equal sums. Quanimous partitions are counted by A321452 and ranked by A321454.

Examples

			The a(0) = 1 through a(9) = 8 strict partitions:
  ()  (1)  (2)  (3)   (4)   (5)   (6)   (7)    (8)    (9)
                (21)  (31)  (32)  (42)  (43)   (53)   (54)
                            (41)  (51)  (52)   (62)   (63)
                                        (61)   (71)   (72)
                                        (421)  (521)  (81)
                                                      (432)
                                                      (531)
                                                      (621)
		

Crossrefs

The non-strict "bi-" complement is A002219, ranks A357976.
The "bi-" version is A321142 or A371794, complement A237258, ranks A357854.
The non-strict version is A321451, ranks A321453.
The complement is A371737, non-strict A321452, ranks A321454.
The non-strict "bi-" version is A371795, ranks A371731.
A108917 counts knapsack partitions, ranks A299702, strict A275972.
A366754 counts non-knapsack partitions, ranks A299729, strict A316402.
A371783 counts k-quanimous partitions.
A371789 counts non-quanimous sets, differences A371790.
A371792 counts non-biquanimous sets, complement A371791.
A371796 counts quanimous sets, differences A371797.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&Length[Select[sps[#], SameQ@@Total/@#&]]==1&]],{n,0,30}]

Formula

a(prime(k)) = A064688(k) = A000009(A000040(k)).

A371793 Number of non-biquanimous subsets of {1..n} containing n.

Original entry on oeis.org

1, 2, 3, 6, 12, 22, 44, 84, 163, 314, 610, 1184, 2308, 4505, 8843, 17386, 34336, 67881, 134662, 267431, 532172, 1060048, 2113947, 4218325, 8423138, 16826162, 33623311, 67205646, 134351795, 268621562, 537124814, 1074092608, 2147953084, 4295613139, 8590784715, 17181035797, 34361248692, 68721546255, 137441586921, 274881519876, 549760320576, 1099517861045, 2199030848627, 4398057100987, 8796105652038, 17592203866158
Offset: 1

Views

Author

Gus Wiseman, Apr 07 2024

Keywords

Comments

A finite multiset of numbers is defined to be biquanimous iff it can be partitioned into two multisets with equal sums. Biquanimous partitions are counted by A002219 and ranked by A357976.

Examples

			The a(1) = 1 through a(5) = 12 subsets:
  {1}  {2}    {3}    {4}      {5}
       {1,2}  {1,3}  {1,4}    {1,5}
              {2,3}  {2,4}    {2,5}
                     {3,4}    {3,5}
                     {1,2,4}  {4,5}
                     {2,3,4}  {1,2,5}
                              {1,3,5}
                              {2,4,5}
                              {3,4,5}
                              {1,2,3,5}
                              {1,3,4,5}
                              {1,2,3,4,5}
		

Crossrefs

The complement is counted by A232466, differences of A371791.
This is the "bi-" version of A371790, differences of A371789.
First differences of A371792.
The complement is the "bi-" version of A371797, differences of A371796.
A002219 aerated counts biquanimous partitions, ranks A357976.
A006827 and A371795 count non-biquanimous partitions, ranks A371731.
A108917 counts knapsack partitions, ranks A299702, strict A275972.
A237258 aerated counts biquanimous strict partitions, ranks A357854.
A321142 and A371794 count non-biquanimous strict partitions.
A321451 counts non-quanimous partitions, ranks A321453.
A321452 counts quanimous partitions, ranks A321454.
A366754 counts non-knapsack partitions, ranks A299729, strict A316402.
A371737 counts quanimous strict partitions, complement A371736.
A371781 lists numbers with biquanimous prime signature, complement A371782.
A371783 counts k-quanimous partitions.

Programs

  • Mathematica
    biqQ[y_]:=MemberQ[Total/@Subsets[y],Total[y]/2];
    Table[Length[Select[Subsets[Range[n]],MemberQ[#,n]&&!biqQ[#]&]],{n,15}]

Extensions

a(16) onwards from Martin Fuller, Mar 21 2025

A248112 Number T(n,k) of subsets of {1,...,n} containing n and having at least one set partition into k blocks with equal element sum; triangle T(n,k), n>=1, 1<=k<=floor((n+1)/2), read by rows.

Original entry on oeis.org

1, 2, 4, 1, 8, 2, 16, 4, 1, 32, 10, 2, 64, 20, 5, 1, 128, 44, 12, 2, 256, 93, 29, 6, 1, 512, 198, 63, 14, 2, 1024, 414, 146, 37, 7, 1, 2048, 864, 329, 88, 16, 2, 4096, 1788, 722, 218, 49, 8, 1, 8192, 3687, 1613, 515, 118, 19, 2, 16384, 7541, 3505, 1226, 313, 62, 9, 1
Offset: 1

Views

Author

Alois P. Heinz, Oct 01 2014

Keywords

Examples

			T(7,3) = 5: {2,3,4,5,7}-> 25/34/7, {1,3,4,6,7}-> 16/34/7, {1,2,5,6,7}-> 16/25/7, {1,2,3,5,6,7}-> 17/26/35, {2,3,4,5,6,7}-> 27/36/45.
T(8,4) = 2: {1,2,3,5,6,7,8}-> 17/26/35/8, {1,2,3,4,5,6,7,8}-> 18/27/36/45.
T(9,5) = 1: {1,2,3,5,6,7,8,9}-> 18/27/36/45/9.
Triangle T(n,k) begins:
01 :    1;
02 :    2;
03 :    4,   1;
04 :    8,   2;
05 :   16,   4,   1;
06 :   32,  10,   2;
07 :   64,  20,   5,  1;
08 :  128,  44,  12,  2;
09 :  256,  93,  29,  6,  1;
10 :  512, 198,  63, 14,  2;
11 : 1024, 414, 146, 37,  7, 1;
12 : 2048, 864, 329, 88, 16, 2;
		

Crossrefs

Programs

  • Maple
    b:= proc(l, i) option remember; local k, r, j;
          k, r:= nops(l), {};
          if i*(i+1)/2 < l[-1]*k-add(j, j=l) then r
        elif i=0 then {r}
        else for j to k do r:= r union map(y->y union {i}, b((p->
               map(x->x-p[1], p))(sort(subsop(j=l[j]+i, l))), i-1))
             od;
             r union b(l, i-1)
          fi
        end:
    A:= (n, k)-> `if`(k=1, 2^(n-1), nops(b([0$(k-1), n], n-1))):
    seq(seq(A(n, k), k=1..iquo(n+1, 2)), n=1..15);
  • Mathematica
    b[l_, i_] := b[l, i] = Module[{k, r, j}, {k, r} = {Length[l], {}}; Which[ i*(i+1)/2 < l[[-1]]*k - Total[l], r, i == 0, {r}, True, For[j = 1, j <= k, j++, r = r ~Union~ Map[# ~Union~ {i}&, b[Function[p, Map[#-p[[1]]&, p] ][Sort[ReplacePart[l, j -> l[[j]]+i]]], i-1]]]; r ~Union~ b[l, i-1]]]; A[n_, k_] := If[k==1, 2^(n-1), Length[b[Append[Array[0&, (k-1)], n], n-1] ]]; Table[A[n, k], {n, 1, 15}, {k, 1, Quotient[n+1, 2]}] // Flatten (* Jean-François Alcover, Feb 03 2017, Translated from Maple *)

A371839 Number of integer partitions of n with biquanimous multiplicities.

Original entry on oeis.org

1, 0, 0, 1, 1, 2, 3, 4, 6, 9, 11, 16, 22, 29, 38, 52, 66, 88, 114, 147, 186, 245, 302, 389, 486, 613, 757, 960, 1172, 1466, 1790, 2220, 2695, 3332, 4013, 4926, 5938, 7228, 8660, 10519, 12545, 15151, 18041, 21663, 25701, 30774, 36361, 43359, 51149, 60720, 71374
Offset: 0

Views

Author

Gus Wiseman, Apr 18 2024

Keywords

Comments

A finite multiset of numbers is defined to be biquanimous iff it can be partitioned into two multisets with equal sums. Biquanimous partitions are counted by A002219 and ranked by A357976.

Examples

			The partition y = (6,2,1,1) has multiplicities (1,1,2), which are biquanimous because we have the partition ((1,1),(2)), so y is counted under a(10).
The a(0) = 1 through a(10) = 11 partitions:
  ()  .  .  (21)  (31)  (32)  (42)    (43)    (53)    (54)      (64)
                        (41)  (51)    (52)    (62)    (63)      (73)
                              (2211)  (61)    (71)    (72)      (82)
                                      (3211)  (3221)  (81)      (91)
                                              (3311)  (3321)    (3322)
                                              (4211)  (4221)    (4321)
                                                      (4311)    (4411)
                                                      (5211)    (5221)
                                                      (222111)  (5311)
                                                                (6211)
                                                                (322111)
		

Crossrefs

For parts instead of multiplicities we have A002219 aerated, ranks A357976.
These partitions have Heinz numbers A371781.
The complement for parts instead of multiplicities is counted by A371795, ranks A371731, bisections A006827, A058695.
The complement is counted by A371840, ranks A371782.
A237258 = biquanimous strict partitions, ranks A357854, complement A371794.
A321451 counts non-quanimous partitions, ranks A321453.
A321452 counts quanimous partitions, ranks A321454.
A371783 counts k-quanimous partitions.
A371791 counts biquanimous sets, differences A232466.
A371792 counts non-biquanimous sets, differences A371793.

Programs

  • Mathematica
    biqQ[y_]:=MemberQ[Total/@Subsets[y],Total[y]/2];
    Table[Length[Select[IntegerPartitions[n], biqQ[Length/@Split[#]]&]],{n,0,30}]

A371840 Number of integer partitions of n with non-biquanimous multiplicities.

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 8, 11, 16, 21, 31, 40, 55, 72, 97, 124, 165, 209, 271, 343, 441, 547, 700, 866, 1089, 1345, 1679, 2050, 2546, 3099, 3814, 4622, 5654, 6811, 8297, 9957, 12039, 14409, 17355, 20666, 24793, 29432, 35133, 41598, 49474, 58360, 69197, 81395, 96124
Offset: 0

Views

Author

Gus Wiseman, Apr 18 2024

Keywords

Comments

A finite multiset of numbers is defined to be biquanimous iff it can be partitioned into two multisets with equal sums. Biquanimous partitions are counted by A002219 and ranked by A357976.

Examples

			The partition y = (6,2,1,1) has multiplicities (1,1,2), which are biquanimous because we have the partition ((1,1),(2)), so y is not counted under a(10).
The a(1) = 1 through a(8) = 16 partitions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (111)  (22)    (221)    (33)      (322)      (44)
                    (211)   (311)    (222)     (331)      (332)
                    (1111)  (2111)   (321)     (421)      (422)
                            (11111)  (411)     (511)      (431)
                                     (3111)    (2221)     (521)
                                     (21111)   (4111)     (611)
                                     (111111)  (22111)    (2222)
                                               (31111)    (5111)
                                               (211111)   (22211)
                                               (1111111)  (32111)
                                                          (41111)
                                                          (221111)
                                                          (311111)
                                                          (2111111)
                                                          (11111111)
		

Crossrefs

The complement for parts is counted by A002219 aerated, ranks A357976.
These partitions have Heinz numbers A371782.
For parts we have A371795, ranks A371731, bisections A006827, A058695.
The complement is counted by A371839, ranks A371781.
A237258 = biquanimous strict partitions, ranks A357854, complement A371794.
A321451 counts non-quanimous partitions, ranks A321453.
A321452 counts quanimous partitions, ranks A321454.
A371783 counts k-quanimous partitions.
A371791 counts biquanimous sets, differences A232466.
A371792 counts non-biquanimous sets, differences A371793.

Programs

  • Mathematica
    biqQ[y_]:=MemberQ[Total/@Subsets[y],Total[y]/2];
    Table[Length[Select[IntegerPartitions[n], !biqQ[Length/@Split[#]]&]],{n,0,30}]

A371955 Numbers with triquanimous prime indices.

Original entry on oeis.org

8, 27, 36, 48, 64, 125, 150, 180, 200, 216, 240, 288, 320, 343, 384, 441, 490, 512, 567, 588, 630, 700, 729, 756, 784, 810, 840, 900, 972, 1000, 1008, 1080, 1120, 1200, 1296, 1331, 1344, 1440, 1600, 1694, 1728, 1792, 1815, 1920, 2156, 2178, 2197, 2304, 2310
Offset: 1

Views

Author

Gus Wiseman, Apr 19 2024

Keywords

Comments

A finite multiset of numbers is defined to be triquanimous iff it can be partitioned into three multisets with equal sums.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The terms together with their prime indices begin:
     8: {1,1,1}
    27: {2,2,2}
    36: {1,1,2,2}
    48: {1,1,1,1,2}
    64: {1,1,1,1,1,1}
   125: {3,3,3}
   150: {1,2,3,3}
   180: {1,1,2,2,3}
   200: {1,1,1,3,3}
   216: {1,1,1,2,2,2}
   240: {1,1,1,1,2,3}
   288: {1,1,1,1,1,2,2}
   320: {1,1,1,1,1,1,3}
   343: {4,4,4}
   384: {1,1,1,1,1,1,1,2}
   441: {2,2,4,4}
   490: {1,3,4,4}
   512: {1,1,1,1,1,1,1,1,1}
   567: {2,2,2,2,4}
   588: {1,1,2,4,4}
		

Crossrefs

These are the Heinz numbers of the partitions counted by A002220.
For biquanimous we have A357976, counted by A002219.
For non-biquanimous we have A371731, counted by A371795, even case A006827.
A112798 lists prime indices, reverse A296150, length A001222, sum A056239.
A237258 (aerated) counts biquanimous strict partitions, ranks A357854.
A371783 counts k-quanimous partitions.

Programs

  • Maple
    tripart:= proc(L) local t,X,Y,n,cons,i,R;
      t:= convert(L,`+`)/3;
      n:= nops(L);
      if not t::integer then return false fi;
      cons:= [add(L[i]*X[i],i=1..n)=t,
              add(L[i]*Y[i],i=1..n)=t,
              seq(X[i] + Y[i] <= 1, i=1..n)];
      R:= traperror(Optimization:-Maximize(0, cons, assume=binary));
      R::list
    end proc:
    primeindices:= proc(n) local F,t;
      F:= ifactors(n)[2];
      map(t -> numtheory:-pi(t[1])$t[2], F)
    end proc:
    select(tripart @ primindices, [$2..3000]); # Robert Israel, May 19 2025
  • Mathematica
    hwt[n_]:=Total[Cases[FactorInteger[n],{p_,k_}:>PrimePi[p]*k]];
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&, Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    Select[Range[1000],Select[facs[#], Length[#]==3&&SameQ@@hwt/@#&]!={}&]

A232534 Number of subsets of {1,...,n} containing n and having at least one set partition into 3 blocks with equal element sum.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 5, 12, 29, 63, 146, 329, 722, 1613, 3505, 7567, 16119, 34194, 71455, 148917, 307432, 631816, 1290905, 2628736, 5330368
Offset: 1

Views

Author

Alois P. Heinz, Nov 25 2013

Keywords

Comments

Subsets with more than one set partition into 3 blocks with equal element sum are counted only once: {1,2,3,4,5,6,7,8}-> 1236/48/57, 138/246/57, 156/237/48.

Examples

			a(5) = 1: {1,2,3,4,5}-> 14/23/5.
a(6) = 2: {1,2,4,5,6}-> 15/24/6, {1,2,3,4,5,6}-> 16/25/34.
a(7) = 5: {2,3,4,5,7}-> 25/34/7, {1,3,4,6,7}-> 16/34/7, {1,2,5,6,7}-> 16/25/7, {1,2,3,5,6,7}-> 17/26/35, {2,3,4,5,6,7}-> 27/36/45.
a(8) = 12: {2,3,5,6,8}, {1,3,5,7,8}, {1,2,6,7,8}, {2,3,4,6,7,8}, {1,2,3,4,5,7,8}, {1,3,4,5,6,8}, {1,2,4,5,6,7,8}, {1,2,3,6,7,8}, {3,4,5,6,7,8}, {1,2,4,5,7,8}, {1,2,3,4,5,6,7,8}, {1,2,3,4,6,8}.
		

Crossrefs

Cf. A164934, A232466 (2 blocks).
Column k=3 of A248112.

Programs

  • Maple
    b:= proc(n, k, i) option remember; local m; m:= i*(i+1)/2;
          `if`(k>n, b(k, n, i), `if`(i<1, `if`(n=0 and k=0, {0}, {}),
          `if`(k>=0 and n+k>m or k<0 and n-2*k>m, {}, b(n, k, i-1)
           union map(p-> p+x^i, b(n+i, k+i, i-1) union b(n-i, k, i-1)
           union b(n, k-i, i-1)))))
        end:
    a:= n-> nops(b(n, n, n-1)):
    seq(a(n), n=1..15);
  • Mathematica
    b[n_, k_, i_] := b[n, k, i] = Module[{m = i*(i + 1)/2}, If[k > n, b[k, n, i], If[i < 1, If[n == 0 && k == 0, {0}, {}], If[k >= 0 && n + k > m || k < 0 && n - 2*k > m, {}, b[n, k, i - 1] ~Union~ Map[# + x^i &, b[n + i, k + i, i - 1] ~Union~ b[n - i, k, i - 1] ~Union~ b[n, k - i, i - 1]]]]]];
    a[n_] := Length[b[n, n, n - 1]];
    Table[a[n], {n, 1, 20}] (* Jean-François Alcover, May 25 2018, translated from Maple *)

Extensions

a(25) from Alois P. Heinz, Mar 26 2016
Previous Showing 11-20 of 24 results. Next