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

A112972 Number of ways the set {1,2,...,n} can be split into three subsets of equal sums.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 0, 3, 9, 0, 43, 102, 0, 595, 1480, 0, 9294, 23728, 0, 157991, 411474, 0, 2849968, 7562583, 0, 53987864, 145173095, 0, 1061533318, 2885383960, 0, 21515805520, 59003023409, 0, 447142442841, 1235311936936, 0, 9489835046489, 26382363207307
Offset: 1

Views

Author

Floor van Lamoen, Oct 07 2005

Keywords

Examples

			For n=8 we have 84/75/6321, 84/732/651 and 831/75/642 so a(8)=3.
		

Crossrefs

Column k=3 of A275714.
Similar sequences: A327448, A327449, A327450.

Programs

  • Maple
    A112972:= n-> coeff(coeff(mul((x^(-2*k)+x^k*(y^k+y^(-k)))
                  , k=1..n), x, 0), y, 0)/6:
    seq(A112972(n), n=1..20);
    # second Maple program:
    b:= proc() option remember; local i, j, t; `if`(args[1]=0,
          `if`(nargs=2, 1, b(args[t] $t=2..nargs)), add(
          `if`(args[j] -args[nargs]<0, 0, b(sort([seq(args[i]-
          `if`(i=j, args[nargs], 0), i=1..nargs-1)])[],
                    args[nargs]-1)), j=1..nargs-1))
        end:
    a:= n-> (m-> `if`(irem(m, 3)=0, b((m/3)$3, n)/6, 0))(n*(n+1)/2):
    seq(a(n), n=1..42);  # Alois P. Heinz, Sep 03 2009
  • Mathematica
    b[args_List] := b[args] = Module[{nargs = Length[args]}, If[args[[1]] == 0, If[nargs == 2, 1, b[args // Rest]], Sum[If[args[[j]] - Last[args] < 0, 0, b[Append[Sort[Flatten[Table[args[[i]] - If[i == j, Last[args], 0], {i, 1, nargs-1}]]], Last[args]-1]]], {j, 1, nargs-1}]]];
    a[n_] := If[Mod[#, 3] == 0, b[{#/3, #/3, #/3, n}]/6, 0]&[n(n+1)/2];
    Array[a, 42] (* Jean-François Alcover, Oct 30 2020, after Alois P. Heinz *)

Formula

a(n) is 1/6 of the coefficient of x^0*y^0 in Product_{k=1..n} (x^(-2*k)+x^k*(y^k+y^(-k))).

Extensions

Extended beyond a(25) by Alois P. Heinz, Sep 03 2009

A327450 Number of ways the first n squares can be partitioned into three sets with equal sums.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 137, 211, 0, 0, 0, 3035, 0, 0, 0, 120465, 259383, 0, 0, 0, 12328889, 0, 0, 0, 673380980, 1659966694, 0, 0, 0, 69819104134, 0, 0, 0, 3761284888715, 9660240745536, 0, 0, 0, 537238185892321, 0, 0, 0, 29922345673502904
Offset: 1

Views

Author

N. J. A. Sloane, Sep 20 2019

Keywords

Examples

			The unique smallest solution (for n = 13) is 1 + 9 + 25 + 36 + 81 + 121 = 16 + 49 + 64 + 144 = 4 + 100 + 169.
		

References

  • Keith F. Lynch, Posting to Math Fun Mailing List, Sep 19 2019.

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n<2, 0, n^2+s(n-1)) end:
    b:= proc(n, x, y) option remember; `if`(n=1, 1, (p-> (l->
          add(`if`(p>l[i], 0, b(n-1, sort(subsop(i=l[i]-p, l))
                 [1..2][])), i=1..3))([x, y, s(n)-x-y]))(n^2))
        end:
    a:= n-> `if`(irem(1+s(n), 3, 'q')=0, b(n, q-1, q)/2, 0):
    seq(a(n), n=1..27);  # Alois P. Heinz, Sep 29 2019
  • Mathematica
    s[n_] := s[n] = If[n < 2, 0, n^2 + s[n - 1]];
    b[n_, x_, y_] := b[n, x, y] = Module[{p, l}, If[n == 1, 1, p = n^2; l = {x, y, s[n] - x - y}; Sum[If[p > l[[i]], 0, b[n - 1, Sequence @@ Sort[ ReplacePart[l, i -> l[[i]] - p]][[1 ;; 2]]]], {i, 1, 3}]]];
    a[n_] := Module[{q, r}, {q, r} = QuotientRemainder[1 + s[n], 3]; If[r == 0, b[n, q - 1, q]/2, 0]];
    Array[a, 30] (* Jean-François Alcover, Dec 04 2020, after Alois P. Heinz *)

Formula

a(n) > 0 => n in { A140282 }. - Alois P. Heinz, Sep 29 2019

Extensions

a(28)-a(45) from Alois P. Heinz, Sep 29 2019
a(46)-a(53) from Alois P. Heinz, Oct 05 2019

A327448 Number of ways the first n cubes can be partitioned into three sets with equal sums.

Original entry on oeis.org

1, 0, 0, 691, 3416, 0, 233, 1168, 0, 8857, 18157, 0, 2176512, 3628118, 0, 3204865, 8031495, 0, 79514209, 205927212, 0, 5152732369, 13493840291, 0
Offset: 23

Views

Author

N. J. A. Sloane, Sep 19 2019

Keywords

Comments

Note the offset.

Examples

			The unique smallest solution (for n = 23) is
27 + 216 + 1000 + 2197 + 5832 + 6859 + 9261 =
1 + 64 + 343 + 512 + 1728 + 4096 + 8000 + 10648 =
8 + 125 + 729 + 1331 + 2744 + 3375 + 4913 + 12167.
		

References

  • Keith F. Lynch, Posting to Math Fun Mailing List, Sep 17 2019.

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n<2, 0, n^3+s(n-1)) end:
    b:= proc(n, x, y) option remember; `if`(n=1, 1, (p-> (l->
          add(`if`(p>l[i], 0, b(n-1, sort(subsop(i=l[i]-p, l))
                [1..2][])), i=1..3))([x, y, s(n)-x-y]))(n^3))
        end:
    a:= n-> `if`(irem(1+s(n), 3, 'q')=0, b(n, q-1, q)/2, 0):
    seq(a(n), n=23..27);  # Alois P. Heinz, Sep 30 2019
  • Mathematica
    s[n_] := s[n] = If[n < 2, 0, n^3 + s[n - 1]];
    b[n_, x_, y_] := b[n, x, y] = If[n == 1, 1, With[{p = n^3}, Sum[If[p > #[[i]], 0, b[n - 1, Sequence @@ Sort[ReplacePart[#, i -> #[[i]] - p]][[1 ;; 2]]]], {i, 1, 3}]]&[{x, y, s[n] - x - y}]];
    a[n_] := a[n] = If[q = Quotient[1 + s[n], 3]; Mod[1 + s[n], 3] == 0, b[n, q - 1, q]/2, 0];
    Table[Print[n, " ", a[n]]; a[n], {n, 23, 34}] (* Jean-François Alcover, Nov 08 2020, after Alois P. Heinz *)

Formula

a(n) > 0 => n in { A007494 }. - Alois P. Heinz, Sep 30 2019

Extensions

a(32), a(33), a(35) recomputed and a(36)-a(38) added by Alois P. Heinz, Sep 30 2019
a(39)-a(46) from Bert Dobbelaere, May 15 2021

A331479 Table read by rows: row n lists the numbers m such that the first n primes can be partitioned into m subsets all of which have the same sum.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 3, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 1, 3, 1, 2, 4, 5, 1, 3, 1, 2, 4, 1, 3, 1, 2, 4, 1, 7, 1, 2, 1, 3, 1, 2, 4, 5, 1, 3, 1, 2, 4, 1, 3, 1, 2, 4, 5, 8, 1, 3, 9, 1, 2, 4, 5, 8, 1, 3, 1, 2, 4, 7, 1, 3, 1, 2, 4, 1, 3, 1, 2, 4, 8
Offset: 1

Views

Author

Jon E. Schoenfield, Jan 17 2020

Keywords

Comments

Consider the following one-dimensional bin packing problem: given n items whose sizes are the first n primes, list the numbers m such that all the items can be packed into m bins of identical capacity, with each bin packed completely full. The resulting list is row n.
If a row contains a number m, it necessarily contains all divisors of m.

Examples

			In bin-packing terms, for n=19, the sum of the 19 item sizes, i.e., the sum of the first n primes, is 2 + 3 + ... + 67 = 568, whose divisors begin 1, 2, 4, 8, ...; the bin capacity must be at least 67 (the size of the largest item), and 568/67 < 9, so the number of bins m cannot exceed 8. However, the 19 items cannot be packed into 8 bins: the bin capacity would be 568/8 = 71 (which, as an odd sum, would require that each bin containing only odd-sized items -- i.e., every bin other than the one containing the item of size 2 -- contain an odd number of items, hence at least 3 items, but there are only 19 items in total). So the remaining values of m are 1 (i.e., packing all 19 items in a single bin), 2 (e.g., 568/2 = 284 = 67 + 61 + 59 + 53 + 41 + 3 = 47 + 43 + 37 + 31 + 29 + 23 + 19 + 17 + 13 + 11 + 7 + 5 + 2), and 4 (e.g., 568/4 = 142 = 67 + 61 + 11 + 3 = 59 + 53 + 23 + 7 = 47 + 43 + 37 + 13 + 2 = 41 + 31 + 29 + 19 + 17 + 5), so row 19 consists of the numbers 1, 2, and 4.
.                                       Numbers m such that
             Sum of  Divisors m of sum  1st n primes can be
      n-th   1st n       such that      partitioned into m
   n  prime  primes  m <= sum/prime(n)  subsets w/same sum
  --  -----  ------  -----------------  -------------------
   1     2       2   1                  1;
   2     3       5   1                  1;
   3     5      10   1, 2               1, 2;
   4     7      17   1                  1;
   5    11      28   1, 2               1, 2;
   6    13      41   1                  1;
   7    17      58   1, 2               1, 2;
   8    19      77   1                  1;
   9    23     100   1, 2, 4            1, 2;
  10    29     129   1, 3               1, 3;
  11    31     160   1, 2, 4, 5         1, 2, 4;
  12    37     197   1                  1;
  13    41     238   1, 2               1, 2;
  14    43     281   1                  1;
  15    47     328   1, 2, 4            1, 2, 4;
  16    53     381   1, 3               1, 3;
  17    59     440   1, 2, 4, 5         1, 2, 4, 5;
  18    61     501   1, 3               1, 3;
  19    67     568   1, 2, 4, 8         1, 2, 4;
  20    71     639   1, 3, 9            1, 3;
  21    73     712   1, 2, 4, 8         1, 2, 4;
  22    79     791   1, 7               1, 7;
  23    83     874   1, 2               1, 2;
  24    89     963   1, 3, 9            1, 3;
  25    97    1060   1, 2, 4, 5, 10     1, 2, 4, 5;
  26   101    1161   1, 3, 9            1, 3;
  27   103    1264   1, 2, 4, 8         1, 2, 4;
  28   107    1371   1, 3               1, 3;
  29   109    1480   1, 2, 4, 5, 8, 10  1, 2, 4, 5, 8;
  30   113    1593   1, 3, 9            1, 3, 9;
  31   127    1720   1, 2, 4, 5, 8, 10  1, 2, 4, 5, 8;
  32   131    1851   1, 3               1, 3;
  33   137    1988   1, 2, 4, 7, 14     1, 2, 4, 7;
  34   139    2127   1, 3               1, 3;
  35   149    2276   1, 2, 4            1, 2, 4;
  36   151    2427   1, 3               1, 3;
  37   157    2584   1, 2, 4, 8         1, 2, 4, 8;
		

Crossrefs

Showing 1-4 of 4 results.