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.

A196723 Number of subsets of {1..n} (including empty set) such that the pairwise sums of distinct elements are all distinct.

Original entry on oeis.org

1, 2, 4, 8, 15, 28, 50, 86, 143, 236, 376, 594, 913, 1380, 2048, 3016, 4367, 6302, 8974, 12670, 17685, 24580, 33738, 46072, 62367, 83990, 112342, 149734, 198153, 261562, 343210, 448694, 583445, 756846, 976086, 1255658, 1607831, 2053186, 2610560, 3312040, 4183689
Offset: 0

Views

Author

Alois P. Heinz, Oct 06 2011

Keywords

Comments

The number of subsets of {1..n} such that every orderless pair of (not necessarily distinct) elements has a different sum is A143823(n).

Examples

			a(4) = 15: {}, {1}, {2}, {3}, {4}, {1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}, {1,2,3}, {1,2,4}, {1,3,4}, {2,3,4}.
		

Crossrefs

The subset case is A196723 (this sequence).
The maximal case is A325878.
The integer partition case is A325857.
The strict integer partition case is A325877.
Heinz numbers of the counterexamples are given by A325991.

Programs

  • Maple
    b:= proc(n, s) local sn, m;
          m:= nops(s);
          sn:= [s[], n];
          `if`(n<1, 1, b(n-1, s) +`if`(m*(m+1)/2 = nops(({seq(seq(
           sn[i]+sn[j], j=i+1..m+1), i=1..m)})), b(n-1, sn), 0))
        end:
    a:= proc(n) option remember;
          b(n-1, [n]) +`if`(n=0, 0, a(n-1))
        end:
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, s_] := b[n, s] = Module[{sn, m}, m = Length[s]; sn = Append[s, n]; If[n<1, 1, b[n-1, s] + If[m*(m+1)/2 == Length[ Union[ Flatten[ Table[ sn[[i]] + sn[[j]], {i, 1, m}, {j, i+1, m+1}]]]], b[n-1, sn], 0]]];
    a[n_] := a[n] = b[n-1, {n}] + If[n == 0, 0, a[n-1]]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jan 31 2017, translated from Maple *)
    Table[Length[Select[Subsets[Range[n]],UnsameQ@@Plus@@@Subsets[#,{2}]&]],{n,0,10}] (* Gus Wiseman, Jun 03 2019 *)

Extensions

Edited by Gus Wiseman, Jun 03 2019

A196724 Number of subsets of {1..n} (including empty set) such that the pairwise products of distinct elements are all distinct.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 58, 116, 212, 416, 720, 1440, 2340, 4680, 7920, 13024, 23328, 46656, 74168, 148336, 229856, 371424, 615304, 1230608, 1780224, 3401568, 5589360, 9468504, 14397744, 28795488, 40312128, 80624256, 131388480, 206363168, 335814288, 521401536
Offset: 0

Views

Author

Alois P. Heinz, Oct 06 2011

Keywords

Comments

The number of subsets of {1..n} such that every orderless pair of (not necessarily distinct) elements has a different product is A325860(n). - Gus Wiseman, Jun 03 2019

Examples

			a(6) = 58: from the 2^6=64 subsets of {1,2,3,4,5,6} only 6 do not have all the pairwise products of elements distinct: {1,2,3,6}, {2,3,4,6}, {1,2,3,4,6}, {1,2,3,5,6}, {2,3,4,5,6}, {1,2,3,4,5,6}.
		

Crossrefs

The subset case is A196724 (this sequence).
The maximal case is A325859.
The integer partition case is A325856.
The strict integer partition case is A325855.
Heinz numbers of the counterexamples are given by A325993.

Programs

  • Maple
    b:= proc(n, s) local sn, m;
          m:= nops(s);
          sn:= [s[], n];
          `if`(n<1, 1, b(n-1, s) +`if`(m*(m+1)/2 = nops(({seq(seq(
           sn[i]*sn[j], j=i+1..m+1), i=1..m)})), b(n-1, sn), 0))
        end:
    a:= proc(n) option remember;
          b(n-1, [n]) +`if`(n=0, 0, a(n-1))
        end:
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, s_] := b[n, s] = Module[{sn, m}, m = Length[s]; sn = Append[s, n]; If[n < 1, 1, b[n - 1, s] + If[m*(m + 1)/2 == Length[Union[Flatten[Table[ sn[[i]] * sn[[j]], {i, 1, m}, {j, i + 1, m + 1}]]]], b[n - 1, sn], 0]]]; a[n_] := a[n] = b[n - 1, {n}] + If[n == 0, 0, a[n - 1]]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jan 31 2017, translated from Maple *)
    Table[Length[Select[Subsets[Range[n]],UnsameQ@@Times@@@Subsets[#,{2}]&]],{n,0,10}] (* Gus Wiseman, Jun 03 2019 *)

Extensions

Name edited by Gus Wiseman, Jun 03 2019
a(33)-a(35) from Fausto A. C. Cariboni, Oct 05 2020

A196720 Number of subsets of {1..n} (including empty set) such that the pairwise GCDs of elements are not distinct.

Original entry on oeis.org

1, 2, 4, 8, 13, 25, 33, 61, 81, 116, 140, 256, 282, 530, 606, 692, 823, 1551, 1653, 3173, 3391, 3805, 4177, 8049, 8345, 11524, 12508, 15294, 16204, 31692, 32048, 63280, 70834, 77224, 82048, 91686, 93597, 185245, 196109, 212359, 218223, 432495, 436031, 867647
Offset: 0

Views

Author

Alois P. Heinz, Oct 05 2011

Keywords

Comments

All pairwise GCDs of each subset are equal if there are any.
a(n) >= A084422(n).

Examples

			a(5) = 25: {}, {1}, {2}, {3}, {4}, {5}, {1,2}, {1,3}, {1,4}, {1,5}, {2,3}, {2,4}, {2,5}, {3,4}, {3,5}, {4,5}, {1,2,3}, {1,2,5}, {1,3,4}, {1,3,5}, {1,4,5}, {2,3,5}, {3,4,5}, {1,2,3,5}, {1,3,4,5}.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, s) local sn, m;
          m:= nops(s);
          sn:= [s[], n];
          `if`(n<1, 1, b(n-1, s) +`if`(1 >= nops(({seq(seq(
               igcd(sn[i], sn[j]), j=i+1..m+1), i=1..m)})), b(n-1, sn), 0))
        end:
    a:= proc(n) option remember;
          b(n-1, [n]) +`if`(n=0, 0, a(n-1))
        end:
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, s_] := b[n, s] = With[{m = Length[s], sn = Append[s, n]}, If[n<1, 1, b[n-1, s] + If[1 >= Length[ Union @ Flatten @ Table[ Table[ GCD[ sn[[i]], sn[[j]]], {j, i+1, m+1}], {i, 1, m}]], b[n-1, sn], 0]]];
    a[n_] := a[n] = b[n-1, {n}] + If[n == 0, 0, a[n-1]];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Apr 06 2017, translated from Maple *)

A196721 Number of subsets of {1..n} (including empty set) such that the pairwise LCMs of elements are all distinct.

Original entry on oeis.org

1, 2, 4, 8, 14, 28, 42, 84, 132, 236, 352, 704, 920, 1840, 2736, 3816, 5700, 11400, 15384, 30768, 39552, 54656, 81672, 163344, 196176, 362656, 542304, 930352, 1195168, 2390336, 2914304, 5828608, 8513920, 11674848, 17490432, 23484224, 28058816, 56117632, 84100800
Offset: 0

Views

Author

Alois P. Heinz, Oct 05 2011

Keywords

Examples

			a(4) = 14: {}, {1}, {2}, {3}, {4}, {1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}, {1,2,3}, {1,3,4}, {2,3,4}.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, s) local sn, m;
          m:= nops(s);
          sn:= [s[], n];
          `if`(n<1, 1, b(n-1, s) +`if`(m*(m+1)/2 = nops(({seq(seq(
           ilcm(sn[i], sn[j]), j=i+1..m+1), i=1..m)})), b(n-1, sn), 0))
        end:
    a:= proc(n) option remember;
          b(n-1, [n]) +`if`(n=0, 0, a(n-1))
        end:
    seq(a(n), n=0..10);
  • Mathematica
    b[n_, s_] := b[n, s] = Module[{sn, m}, m = Length[s]; sn = Append[s, n]; If[n < 1, 1, b[n - 1, s] + If[m*(m + 1)/2 == Length @ Union @ Flatten @ Table[LCM [sn[[i]], sn[[j]]], {i, 1, m}, {j, i+1, m+1}], b[n-1, sn], 0]]]; a[n_] := a[n] = b[n-1, {n}] + If[n == 0, 0, a[n-1]]; Table[ Print["a(", n, ") = ", a[n]]; a[n], {n, 0, 30}] (* Jean-François Alcover, Feb 02 2017, translated from Maple *)

Extensions

Terms a(31) and beyond from Fausto A. C. Cariboni, Oct 18 2020

A196722 Number of subsets of {1..n} (including empty set) such that the pairwise LCMs of elements are not distinct.

Original entry on oeis.org

1, 2, 4, 7, 11, 16, 23, 30, 38, 47, 58, 69, 83, 96, 111, 128, 144, 161, 181, 200, 223, 246, 269, 292, 319, 344, 371, 398, 429, 458, 496, 527, 559, 594, 629, 668, 708, 745, 784, 825, 870, 911, 962, 1005, 1052, 1102, 1149, 1196, 1248, 1297, 1349, 1402, 1457, 1510
Offset: 0

Views

Author

Alois P. Heinz, Oct 05 2011

Keywords

Comments

All pairwise LCMs of each subset are equal if there are any.

Examples

			A(6) = 23: {}, {1}, {2}, {3}, {4}, {5}, {6}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {2,3}, {2,4}, {2,5}, {2,6}, {3,4}, {3,5}, {3,6}, {4,5}, {4,6}, {5,6}, {2,3,6}.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, s) local sn, m;
          m:= nops(s);
          sn:= [s[], n];
          `if`(n<1, 1, b(n-1, s) +`if`(1 >= nops(({seq(seq(
               ilcm(sn[i], sn[j]), j=i+1..m+1), i=1..m)})), b(n-1, sn), 0))
        end:
    a:= proc(n) option remember;
          b(n-1, [n]) +`if`(n=0, 0, a(n-1))
        end:
    seq(a(n), n=0..50);
  • Mathematica
    b[n_, s_] := b[n, s] = Module[{sn, m}, m = Length[s]; sn = Append[s, n]; If[n<1, 1, b[n-1, s] + If[1 >= Length @ Union @ Flatten @ Table[ LCM[ sn[[i]], sn[[j]]], {i, 1, m}, {j, i+1, m+1}], b[n-1, sn], 0]]];
    a[n_] := a[n] = b[n-1, {n}] + If[n == 0, 0, a[n-1]];
    Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Apr 12 2017, translated from Maple *)
Showing 1-5 of 5 results.