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.

A326441 Number of subsets of {1..n} whose sum is equal to the product of their complement.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 3, 1, 2, 1, 3, 3, 3, 3, 1, 4, 4, 3, 2, 2, 4, 3, 5, 3, 2, 4, 5, 4, 5, 6, 1, 4, 2, 5, 4, 7, 4, 4, 3, 3, 6, 14, 3, 4, 10, 6, 3, 6, 4, 4, 4, 8, 7, 6, 8, 7, 10, 5, 11, 8, 5, 11, 4, 7, 7, 5, 8, 12, 5, 6, 9, 8, 11, 8, 5, 8, 9, 8, 10, 8
Offset: 0

Views

Author

Gus Wiseman, Jul 07 2019

Keywords

Comments

Essentially the same as A178830. - R. J. Mathar, Jul 12 2019

Examples

			The initial terms count the following subsets:
   1: {1}
   3: {1,2}
   5: {3,5}
   6: {3,4,5}
   7: {2,4,5,7}
   8: {2,4,5,6,7}
   9: {2,3,5,6,7,9}
  10: {4,5,6,8,9,10}
  10: {2,3,5,6,7,8,9}
  10: {1,2,3,4,5,8,9,10}
Also the number of subsets of {1..n} whose product is equal to the sum of their complement. For example, the initial terms count the following subsets:
   1: {}
   3: {3}
   5: {1,2,4}
   6: {1,2,6}
   7: {1,3,6}
   8: {1,3,8}
   9: {1,4,8}
  10: {6,7}
  10: {1,4,10}
  10: {1,2,3,7}
		

Crossrefs

Programs

  • Maple
    b:= proc(n, s, p)
          `if`(s=p, 1, `if`(n<1, 0, b(n-1, s, p)+
          `if`(s-n b(n, n*(n+1)/2, 1):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jul 12 2019
  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Plus@@#==Times@@Complement[Range[n],#]&]],{n,0,10}]

Extensions

a(21)-a(83) from Giovanni Resta, Jul 08 2019

A207852 Smallest number m such that there are exactly n ways to partition the numbers {1,...,m} into nonempty sets P and S with the product of the elements of P equal to the sum of elements in S.

Original entry on oeis.org

1, 3, 12, 10, 19, 26, 33, 39, 55, 74, 48, 62, 71, 99, 45, 140, 96, 176, 104, 144, 159, 175, 230, 191, 320, 328, 240, 334, 259, 344, 279, 308, 303, 505, 419, 560, 714, 550, 455, 665, 684, 670, 751, 935, 899, 800, 1051, 776, 928, 602, 749, 1104, 689, 1295, 1364
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 21 2012

Keywords

Comments

A178830(a(n)) = n and A178830(m) <> n for m < a(n).

Examples

			a(1) =  3: 3 = 1+2;
a(2) = 12: 1*5*12 = 2+3+4+6+7+8+9+10+11, 2*4*8 = 1+3+5+6+7+9+10+11+12;
a(3) = 10: 1*2*3*7 = 4+5+6+8+9+10, 1*4*10 = 2+3+5+6+7+8+9, 6*7 = 1+2+3+4+5+8+9+10.
		

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a207852 n = (fromJust $ elemIndex n a178830_list) + 1

Extensions

a(25)-a(54) from Alois P. Heinz, Jun 07 2012

A213237 Number of distinct values v satisfying v = sum of elements in S = product of elements in P for any partition of {1,...,n} into two sets S and P.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Jun 07 2012

Keywords

Examples

			a(1) = 1: S={1}, P={}, v=1.
a(2) = 0: no partition of {1,2} satisfies the condition.
a(3) = 1: S={1,2}, P={3}, v=3.
a(10) = 2: three partitions of {1,2,...,10} into S and P satisfy v = Sum_{i:S} i = Product_{k:P} k but there are only two distinct values v: S={2,3,5,6,7,8,9}, P={1,4,10}, v=40; S={4,5,6,8,9,10}, P={1,2,3,7}, v=42; S={1,2,3,4,5,8,9,10}, P={6,7}, v=42.
		

Crossrefs

The values v are in A213238.

Programs

  • Maple
    b:= proc(n, s, p)
          `if`(s=p, {s}, `if`(n<1, {}, {b(n-1, s, p)[],
          `if`(s-n nops(b(n, n*(n+1)/2, 1)):
    seq(a(n), n=1..100);
  • Mathematica
    b[n_, s_, p_] := b[n, s, p] = If[s == p, {s}, If[n < 1, {}, Union[b[n - 1, s, p], If[s - n < p n, {}, b[n - 1, s - n, p n]]]]];
    a[n_] := Length[b[n, n(n+1)/2, 1]];
    Array[a, 100] (* Jean-François Alcover, Dec 07 2020, after Alois P. Heinz *)

A325538 Number of subsets of {1..n} whose product is one more than the sum of their complement.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 2, 0, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 0, 4, 2, 2, 4, 2, 2, 5, 5, 1, 2, 2, 3, 2, 5, 3, 4, 2, 2, 3, 10, 2, 4, 7, 5, 3, 3, 7, 6, 4, 4, 5, 5, 5, 2, 6, 4, 6, 5, 3, 8, 4, 5, 4, 5, 2, 10, 5, 3, 7, 11, 6, 10, 5, 11, 6, 4, 7, 6, 10
Offset: 0

Views

Author

Gus Wiseman, Jul 07 2019

Keywords

Comments

Also by definition the number of subsets whose sum is one fewer than the product of their complement.

Examples

			The initial terms count the following subsets:
   0: {}
   1: {1}
   2: {2}
   3: {1,3}
   4: {2,3}
   7: {4,5}
  10: {1,6,7}
  12: {7,9}
  12: {1,2,4,8}
  14: {2,5,9}
  14: {1,2,4,11}
  15: {1,3,5,7}
  16: {3,4,10}
  16: {1,3,5,8}
  17: {1,10,13}
  18: {2,5,15}
  19: {11,15}
  19: {1,2,6,14}
  20: {1,4,6,8}
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],1+Plus@@#==Times@@Complement[Range[n],#]&]],{n,0,10}]
    ric[n_, pr_, s_, lst_, t_] := Block[{k}, If[pr == t-s, cnt++]; Do[ If[pr k <= t, ric[n, pr k, s + k, k, t], Break[]], {k, lst+1, n}]]; a[n_] := (cnt = 0; ric[n, 1, 0, 0, n (n + 1)/2 + 1]; cnt); a /@ Range[0, 85] (* Giovanni Resta, Sep 13 2019 *)

Extensions

More terms from Alois P. Heinz, Jul 12 2019
Showing 1-4 of 4 results.