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

A306443 Number of ways of partitioning the set of the first n primes into two subsets whose sums differ at most by 1.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 3, 2, 6, 5, 16, 13, 45, 39, 138, 122, 439, 392, 1417, 1286, 4698, 4341, 16021, 14860, 55146, 51085, 190274, 178402, 671224, 634511, 2404289, 2260918, 8535117, 8067237, 30635869, 29031202, 110496946, 105250449, 401422210, 383579285, 1467402238
Offset: 0

Views

Author

Alois P. Heinz, May 31 2019

Keywords

Examples

			a(8) = 6: 2,17,19/3,5,7,11,13; 3,5,11,19/2,7,13,17; 3,5,13,17/2,7,11,19; 3,7,11,17/2,5,13,19; 2,3,5,11,17/7,13,19; 2,5,7,11,13/3,17,19.
a(9) = 5: 2,3,5,17,23/7,11,13,19; 2,5,7,13,23/3,11,17,19; 2,5,7,17,19/3,11,13,23; 2,5,11,13,19/3,7,17,23; 2,7,11,13,17/3,5,19,23.
		

Crossrefs

Bisections give: A022894 (odd part), A113040 (even part).

Programs

  • Maple
    s:= proc(n) s(n):= `if`(n=0, 1, ithprime(n)+s(n-1)) end:
    b:= proc(n, i) option remember; `if`(i=0, `if`(n<=1, 1, 0),
         `if`(n>s(i), 0, (p->b(n+p, i-1)+b(abs(n-p), i-1))(ithprime(i))))
        end:
    a:= n-> ceil(b(0, n)/2):
    seq(a(n), n=0..45);
  • Mathematica
    s[n_] := s[n] = If[n == 0, 1, Prime[n] + s[n - 1]];
    b[n_, i_] := b[n, i] = If[i==0, If[n <= 1, 1, 0], If[n > s[i], 0, Function[ p, b[n + p, i - 1] + b[Abs[n - p], i - 1]][Prime[i]]]];
    a[n_] := Ceiling[b[0, n]/2];
    a /@ Range[0, 45] (* Jean-François Alcover, Apr 30 2020, after Alois P. Heinz *)

A308682 Number of ways of partitioning the set of the first n positive triangular numbers into two subsets whose sums differ at most by 1.

Original entry on oeis.org

1, 1, 0, 0, 1, 1, 1, 1, 2, 7, 6, 8, 13, 42, 33, 52, 105, 318, 310, 485, 874, 3281, 2974, 5240, 9488, 34233, 30418, 55715, 104730, 378529, 352467, 642418, 1193879, 4466874, 4165910, 7762907, 14493951, 54162165, 50621491, 95133799, 179484713, 674845081
Offset: 0

Views

Author

Alois P. Heinz, Jun 16 2019

Keywords

Examples

			a(4) = 1: 1,3,6/10.
a(5) = 1: 1,6,10/3,15.
a(6) = 1: 1,6,21/3,10,15.
a(7) = 1: 1,3,10,28/6,15,21.
a(8) = 2: 1,6,10,15,28/3,21,36; 1,10,21,28/3,6,15,36.
		

Crossrefs

Programs

  • Maple
    s:= proc(n) s(n):= `if`(n=0, 1, n*(n+1)/2+s(n-1)) end:
    b:= proc(n, i) option remember; `if`(i=0, `if`(n<=1, 1, 0),
         `if`(n>s(i), 0, (p->b(n+p, i-1)+b(abs(n-p), i-1))(i*(i+1)/2)))
        end:
    a:= n-> ceil(b(0, n)/2):
    seq(a(n), n=0..45);
  • Mathematica
    s[n_] := s[n] = If[n == 0, 1, n(n+1)/2 + s[n-1]];
    b[n_, i_] := b[n, i] = If[i == 0, If[n <= 1, 1, 0], If[n > s[i], 0, Function[p, b[n + p, i-1] + b[Abs[n-p], i-1]][i(i+1)/2]]];
    a[n_] := Ceiling[b[0, n]/2];
    a /@ Range[0, 45] (* Jean-François Alcover, May 04 2020, translated from Maple *)
Showing 1-2 of 2 results.