A276187
Number of subsets of {1,..,n} of cardinality >= 2 such that the elements of each counted subset are pairwise coprime.
Original entry on oeis.org
0, 1, 4, 7, 18, 21, 48, 63, 94, 105, 220, 235, 482, 529, 600, 711, 1438, 1501, 3020, 3211, 3594, 3849, 7720, 7975, 11142, 11877, 14628, 15459, 30946, 31201, 62432, 69855, 76126, 80221, 89820, 91611, 183258, 192601, 208600, 214231, 428502, 431573, 863188, 900563
Offset: 1
From _Gus Wiseman_, May 08 2021: (Start)
The a(2) = 1 through a(6) = 21 sets:
{1,2} {1,2} {1,2} {1,2} {1,2}
{1,3} {1,3} {1,3} {1,3}
{2,3} {1,4} {1,4} {1,4}
{1,2,3} {2,3} {1,5} {1,5}
{3,4} {2,3} {1,6}
{1,2,3} {2,5} {2,3}
{1,3,4} {3,4} {2,5}
{3,5} {3,4}
{4,5} {3,5}
{1,2,3} {4,5}
{1,2,5} {5,6}
{1,3,4} {1,2,3}
{1,3,5} {1,2,5}
{1,4,5} {1,3,4}
{2,3,5} {1,3,5}
{3,4,5} {1,4,5}
{1,2,3,5} {1,5,6}
{1,3,4,5} {2,3,5}
{3,4,5}
{1,2,3,5}
{1,3,4,5}
(End)
The indivisible instead of coprime version is
A051026(n) - n.
Allowing empty sets and singletons gives
A084422.
The relatively prime instead of pairwise coprime version is
A085945(n) - 1.
Allowing all singletons gives
A187106.
Allowing only the singleton {1} gives
A320426.
Row sums of
A320436, each minus one.
The maximal case is counted by
A343659.
The version for sets of divisors is
A343655(n) - 1.
A186972 counts pairwise coprime k-sets containing n.
A186974 counts pairwise coprime k-sets.
A326675 ranks pairwise coprime non-singleton sets.
-
f:= proc(S) option remember;
local s, Sp;
if S = {} then return 1 fi;
s:= S[-1];
Sp:= S[1..-2];
procname(Sp) + procname(select(t -> igcd(t,s)=1, Sp))
end proc:
seq(f({$1..n}) - n - 1, n=1..50); # Robert Israel, Aug 24 2016
-
f[S_] := f[S] = Module[{s, Sp}, If[S == {}, Return[1]]; s = S[[-1]]; Sp = S[[1;;-2]]; f[Sp] + f[Select[Sp, GCD[#, s] == 1&]]];
Table[f[Range[n]] - n - 1, {n, 1, 50}] (* Jean-François Alcover, Sep 15 2022, after Robert Israel *)
-
f(n,k=1)=if(n==1, return(2)); if(gcd(k,n)==1, f(n-1,n*k)) + f(n-1,k)
a(n)=f(n)-n-1 \\ Charles R Greathouse IV, Aug 24 2016
-
from sage.combinat.subsets_pairwise import PairwiseCompatibleSubsets
def is_coprime(x, y): return gcd(x, y) == 1
max_n = 40
seq = []
for n in range(1, max_n+1):
P = PairwiseCompatibleSubsets(range(1,n+1), is_coprime)
a_n = len([1 for s in P.list() if len(s) > 1])
seq.append(a_n)
print(seq)
A337450
Number of relatively prime compositions of n with no 1's.
Original entry on oeis.org
0, 0, 0, 0, 0, 2, 0, 7, 5, 17, 17, 54, 51, 143, 168, 358, 482, 986, 1313, 2583, 3663, 6698, 9921, 17710, 26489, 46352, 70928, 121137, 188220, 317810, 497322, 832039, 1313501, 2177282, 3459041, 5702808, 9094377, 14930351, 23895672, 39084070, 62721578
Offset: 0
The a(5) = 2 through a(10) = 17 compositions (empty column indicated by dot):
(2,3) . (2,5) (3,5) (2,7) (3,7)
(3,2) (3,4) (5,3) (4,5) (7,3)
(4,3) (2,3,3) (5,4) (2,3,5)
(5,2) (3,2,3) (7,2) (2,5,3)
(2,2,3) (3,3,2) (2,2,5) (3,2,5)
(2,3,2) (2,3,4) (3,3,4)
(3,2,2) (2,4,3) (3,4,3)
(2,5,2) (3,5,2)
(3,2,4) (4,3,3)
(3,4,2) (5,2,3)
(4,2,3) (5,3,2)
(4,3,2) (2,2,3,3)
(5,2,2) (2,3,2,3)
(2,2,2,3) (2,3,3,2)
(2,2,3,2) (3,2,2,3)
(2,3,2,2) (3,2,3,2)
(3,2,2,2) (3,3,2,2)
A000740 is the version allowing 1's.
2*
A055684(n) is the case of length 2.
A337452 is the unordered strict version.
A000837 counts relatively prime partitions.
A002865 counts partitions with no 1's.
A101268 counts singleton or pairwise coprime compositions.
A212804 counts compositions with no 1's.
A291166 appears to rank relatively prime compositions.
A337462 counts pairwise coprime compositions.
-
b:= proc(n, g) option remember; `if`(n=0,
`if`(g=1, 1, 0), add(b(n-j, igcd(g, j)), j=2..n))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..42);
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[#,1]&&GCD@@#==1&]],{n,0,15}]
A101391
Triangle read by rows: T(n,k) is the number of compositions of n into k parts x_1, x_2, ..., x_k such that gcd(x_1,x_2,...,x_k) = 1 (1<=k<=n).
Original entry on oeis.org
1, 0, 1, 0, 2, 1, 0, 2, 3, 1, 0, 4, 6, 4, 1, 0, 2, 9, 10, 5, 1, 0, 6, 15, 20, 15, 6, 1, 0, 4, 18, 34, 35, 21, 7, 1, 0, 6, 27, 56, 70, 56, 28, 8, 1, 0, 4, 30, 80, 125, 126, 84, 36, 9, 1, 0, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1, 0, 4, 42, 154, 325, 461, 462, 330, 165, 55, 11, 1, 0, 12, 66, 220, 495, 792, 924, 792, 495, 220, 66, 12, 1
Offset: 1
T(6,3)=9 because we have 411,141,114 and the six permutations of 123 (222 does not qualify).
T(8,3)=18 because binomial(0,2)*mobius(8/1)+binomial(1,2)*mobius(8/2)+binomial(3,2)*mobius(8/4)+binomial(7,2)*mobius(8/8)=0+0+(-3)+21=18.
Triangle begins:
1;
0, 1;
0, 2, 1;
0, 2, 3, 1;
0, 4, 6, 4, 1;
0, 2, 9, 10, 5, 1;
0, 6, 15, 20, 15, 6, 1;
0, 4, 18, 34, 35, 21, 7, 1;
0, 6, 27, 56, 70, 56, 28, 8, 1;
0, 4, 30, 80, 125, 126, 84, 36, 9, 1;
0, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1;
0, 4, 42, 154, 325, 461, 462, 330, 165, 55, 11, 1;
0, 12, 66, 220, 495, 792, 924, 792, 495, 220, 66, 12, 1;
...
From _Gus Wiseman_, Oct 19 2020: (Start)
Row n = 6 counts the following compositions:
(15) (114) (1113) (11112) (111111)
(51) (123) (1122) (11121)
(132) (1131) (11211)
(141) (1212) (12111)
(213) (1221) (21111)
(231) (1311)
(312) (2112)
(321) (2121)
(411) (2211)
(3111)
Missing are: (42), (24), (33), (222).
(End)
- Alois P. Heinz, Rows n = 1..200, flattened
- H. W. Gould, Binomial coefficients, the bracket function and compositions with relatively prime summands, Fib. Quart. 2(4) (1964), 241-260.
- Temba Shonhiwa, Compositions with pairwise relatively prime summands within a restricted setting, Fibonacci Quart. 44 (2006), no. 4, 316-323.
A000837 counts relatively prime partitions.
A135278 counts compositions by length.
A282748 is the pairwise coprime instead of relatively prime version.
A291166 ranks these compositions (evidently).
-
with(numtheory): T:=proc(n,k) local d, j, b: d:=divisors(n): for j from 1 to tau(n) do b[j]:=binomial(d[j]-1,k-1)*mobius(n/d[j]) od: sum(b[i],i=1..tau(n)) end: for n from 1 to 14 do seq(T(n,k),k=1..n) od; # yields the sequence in triangular form
# second Maple program:
b:= proc(n, g) option remember; `if`(n=0, `if`(g=1, 1, 0),
expand(add(b(n-j, igcd(g, j))*x, j=1..n)))
end:
T:= (n, k)-> coeff(b(n,0),x,k):
seq(seq(T(n,k), k=1..n), n=1..14); # Alois P. Heinz, May 05 2025
-
t[n_, k_] := Sum[Binomial[d-1, k-1]*MoebiusMu[n/d], {d, Divisors[n]}]; Table[t[n, k], {n, 2, 14}, {k, 2, n}] // Flatten (* Jean-François Alcover, Jan 20 2014 *)
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],GCD@@#==1&]],{n,10},{k,2,n}] (* change {k,2,n} to {k,1,n} for the version with zeros. - Gus Wiseman, Oct 19 2020 *)
-
T(n, k) = sumdiv(n, d, binomial(d-1, k-1)*moebius(n/d)); \\ Michel Marcus, Mar 09 2016
A366844
Number of strict integer partitions of n into odd relatively prime parts.
Original entry on oeis.org
0, 1, 0, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 2, 3, 3, 5, 4, 4, 5, 6, 7, 8, 8, 9, 11, 12, 12, 15, 16, 15, 19, 23, 23, 26, 28, 30, 34, 37, 38, 44, 48, 48, 56, 62, 63, 72, 77, 82, 92, 96, 102, 116, 124, 128, 142, 155, 162, 178, 191, 200, 222, 236, 246, 276, 291, 303, 334
Offset: 0
The a(n) partitions for n = 1, 8, 14, 17, 16, 20, 21:
(1) (5,3) (9,5) (9,5,3) (9,7) (11,9) (9,7,5)
(7,1) (11,3) (9,7,1) (11,5) (13,7) (11,7,3)
(13,1) (11,5,1) (13,3) (17,3) (11,9,1)
(13,3,1) (15,1) (19,1) (13,5,3)
(7,5,3,1) (9,7,3,1) (13,7,1)
(11,5,3,1) (15,5,1)
(17,3,1)
This is the relatively prime case of
A000700.
The pairwise coprime version is the odd-part case of
A007360.
The halved even version is
A078374 aerated.
The complement is counted by the strict case of
A366852, with evens
A018783.
A113685 counts partitions by sum of odd parts, rank statistic
A366528.
A366842 counts partitions whose odd parts have a common divisor > 1.
Cf.
A007359,
A047967,
A055922,
A066208,
A116598,
A239261,
A302697,
A337485,
A365067,
A366845,
A366848.
-
Table[Length[Select[IntegerPartitions[n], And@@OddQ/@#&&UnsameQ@@#&&GCD@@#==1&]],{n,0,30}]
-
from math import gcd
from sympy.utilities.iterables import partitions
def A366844(n): return sum(1 for p in partitions(n) if all(d==1 for d in p.values()) and all(d&1 for d in p) and gcd(*p)==1) # Chai Wah Wu, Oct 30 2023
A337984
Heinz numbers of pairwise coprime integer partitions with no 1's, where a singleton is not considered coprime.
Original entry on oeis.org
15, 33, 35, 51, 55, 69, 77, 85, 93, 95, 119, 123, 141, 143, 145, 155, 161, 165, 177, 187, 201, 205, 209, 215, 217, 219, 221, 249, 253, 255, 265, 287, 291, 295, 309, 323, 327, 329, 335, 341, 355, 381, 385, 391, 395, 403, 407, 411, 413, 415, 437, 447, 451, 465
Offset: 1
The sequence of terms together with their prime indices begins:
15: {2,3} 155: {3,11} 265: {3,16}
33: {2,5} 161: {4,9} 287: {4,13}
35: {3,4} 165: {2,3,5} 291: {2,25}
51: {2,7} 177: {2,17} 295: {3,17}
55: {3,5} 187: {5,7} 309: {2,27}
69: {2,9} 201: {2,19} 323: {7,8}
77: {4,5} 205: {3,13} 327: {2,29}
85: {3,7} 209: {5,8} 329: {4,15}
93: {2,11} 215: {3,14} 335: {3,19}
95: {3,8} 217: {4,11} 341: {5,11}
119: {4,7} 219: {2,21} 355: {3,20}
123: {2,13} 221: {6,7} 381: {2,31}
141: {2,15} 249: {2,23} 385: {3,4,5}
143: {5,6} 253: {5,9} 391: {7,9}
145: {3,10} 255: {2,3,7} 395: {3,22}
A302568 considers singletons to be coprime.
A337694 is the pairwise non-coprime instead of pairwise coprime version.
A007359 counts partitions into singleton or pairwise coprime parts with no 1's
A101268 counts pairwise coprime or singleton compositions, ranked by
A335235.
A305713 counts pairwise coprime strict partitions.
A337561 counts pairwise coprime strict compositions.
A337665 counts compositions whose distinct parts are pairwise coprime, ranked by
A333228.
A337697 counts pairwise coprime compositions with no 1's.
A337983 counts pairwise non-coprime strict compositions, with unordered version
A318717 ranked by
A318719.
Cf.
A051424,
A056239,
A087087,
A112798,
A200976,
A220377,
A302569,
A303140,
A303282,
A328673,
A328867.
A337697
Number of pairwise coprime compositions of n with no 1's, where a singleton is not considered coprime.
Original entry on oeis.org
0, 0, 0, 0, 0, 2, 0, 4, 2, 4, 8, 8, 14, 10, 16, 12, 30, 38, 46, 46, 48, 52, 62, 152, 96, 156, 112, 190, 256, 338, 420, 394, 326, 402, 734, 622, 1150, 802, 946, 898, 1730, 1946, 2524, 2200, 2328, 2308, 3356, 5816, 4772, 5350, 4890, 6282, 6316, 12092, 8902
Offset: 0
The a(5) = 2 through a(12) = 14 compositions (empty column indicated by dot):
(2,3) . (2,5) (3,5) (2,7) (3,7) (2,9) (5,7)
(3,2) (3,4) (5,3) (4,5) (7,3) (3,8) (7,5)
(4,3) (5,4) (2,3,5) (4,7) (2,3,7)
(5,2) (7,2) (2,5,3) (5,6) (2,7,3)
(3,2,5) (6,5) (3,2,7)
(3,5,2) (7,4) (3,4,5)
(5,2,3) (8,3) (3,5,4)
(5,3,2) (9,2) (3,7,2)
(4,3,5)
(4,5,3)
(5,3,4)
(5,4,3)
(7,2,3)
(7,3,2)
A022340 intersected with
A333227 is a ranking sequence (using standard compositions
A066099) for these compositions.
A337450 is the relatively prime instead of pairwise coprime version, with strict case
A337451 and unordered version
A302698.
A337485 is the unordered version (or
A007359 with singletons considered coprime), with Heinz numbers
A337984.
A337563 is the case of unordered triples.
-
Table[Length[Join@@Permutations/@Select[IntegerPartitions[n],!MemberQ[#,1]&&CoprimeQ@@#&]],{n,0,30}]
A343655
Number of pairwise coprime sets of divisors of n, where a singleton is not considered pairwise coprime unless it is {1}.
Original entry on oeis.org
1, 2, 2, 3, 2, 6, 2, 4, 3, 6, 2, 10, 2, 6, 6, 5, 2, 10, 2, 10, 6, 6, 2, 14, 3, 6, 4, 10, 2, 22, 2, 6, 6, 6, 6, 17, 2, 6, 6, 14, 2, 22, 2, 10, 10, 6, 2, 18, 3, 10, 6, 10, 2, 14, 6, 14, 6, 6, 2, 38, 2, 6, 10, 7, 6, 22, 2, 10, 6, 22, 2, 24, 2, 6, 10, 10, 6, 22, 2
Offset: 1
For example, the a(n) subsets for n = 1, 2, 4, 6, 8, 12, 16, 24 are:
{1} {1} {1} {1} {1} {1} {1} {1}
{1,2} {1,2} {1,2} {1,2} {1,2} {1,2} {1,2}
{1,4} {1,3} {1,4} {1,3} {1,4} {1,3}
{1,6} {1,8} {1,4} {1,8} {1,4}
{2,3} {1,6} {1,16} {1,6}
{1,2,3} {2,3} {1,8}
{3,4} {2,3}
{1,12} {3,4}
{1,2,3} {3,8}
{1,3,4} {1,12}
{1,24}
{1,2,3}
{1,3,4}
{1,3,8}
The version with empty sets and singletons is
A225520.
A version for prime indices is
A304711.
The version for strict integer partitions is
A305713.
The version for binary indices is
A326675.
The version for integer partitions is
A327516.
The version for standard compositions is
A333227.
The case without 1's with singletons is
A343654.
The maximal case without 1's is
A343660.
A018892 counts coprime unordered pairs of divisors.
A051026 counts pairwise indivisible subsets of {1..n}.
A100565 counts pairwise coprime unordered triples of divisors.
A325683 counts maximal Golomb rulers.
A326077 counts maximal pairwise indivisible sets.
Cf.
A007360,
A062319,
A067824,
A076078,
A084422,
A187106,
A282935,
A285572,
A304709,
A320423,
A337485,
A343659.
A343654
Number of pairwise coprime sets of divisors > 1 of n.
Original entry on oeis.org
1, 2, 2, 3, 2, 5, 2, 4, 3, 5, 2, 8, 2, 5, 5, 5, 2, 8, 2, 8, 5, 5, 2, 11, 3, 5, 4, 8, 2, 15, 2, 6, 5, 5, 5, 13, 2, 5, 5, 11, 2, 15, 2, 8, 8, 5, 2, 14, 3, 8, 5, 8, 2, 11, 5, 11, 5, 5, 2, 25, 2, 5, 8, 7, 5, 15, 2, 8, 5, 15, 2, 18, 2, 5, 8, 8, 5, 15, 2, 14, 5, 5
Offset: 1
The a(n) sets for n = 1, 2, 4, 6, 8, 12, 24, 30, 32, 36, 48:
{} {} {} {} {} {} {} {} {} {} {}
{2} {2} {2} {2} {2} {2} {2} {2} {2} {2}
{4} {3} {4} {3} {3} {3} {4} {3} {3}
{6} {8} {4} {4} {5} {8} {4} {4}
{2,3} {6} {6} {6} {16} {6} {6}
{12} {8} {10} {32} {9} {8}
{2,3} {12} {15} {12} {12}
{3,4} {24} {30} {18} {16}
{2,3} {2,3} {36} {24}
{3,4} {2,5} {2,3} {48}
{3,8} {3,5} {2,9} {2,3}
{5,6} {3,4} {3,4}
{2,15} {4,9} {3,8}
{3,10} {3,16}
{2,3,5}
The version for partitions is
A007359.
The version for subsets of {1..n} is
A084422.
The case without empty sets or singletons is
A343653.
The maximal case without singletons is
A343660.
A018892 counts pairwise coprime unordered pairs of divisors.
A051026 counts pairwise indivisible subsets of {1..n}.
A100565 counts pairwise coprime unordered triples of divisors.
A326077 counts maximal pairwise indivisible sets.
Cf.
A007360,
A051026,
A062319,
A074206,
A087087,
A101268,
A285572,
A305713,
A320423,
A326675,
A337485,
A343655.
-
pwcop[y_]:=And@@(GCD@@#1==1&)/@Subsets[y,{2}];
Table[Length[Select[Subsets[Rest[Divisors[n]]],pwcop]],{n,100}]
A343653
Number of non-singleton pairwise coprime nonempty sets of divisors > 1 of n.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 1, 0, 0, 2, 0, 2, 1, 1, 0, 3, 0, 1, 0, 2, 0, 7, 0, 0, 1, 1, 1, 4, 0, 1, 1, 3, 0, 7, 0, 2, 2, 1, 0, 4, 0, 2, 1, 2, 0, 3, 1, 3, 1, 1, 0, 13, 0, 1, 2, 0, 1, 7, 0, 2, 1, 7, 0, 6, 0, 1, 2, 2, 1, 7, 0, 4, 0, 1, 0, 13, 1, 1
Offset: 1
The a(n) sets for n = 6, 12, 24, 30, 36, 60, 72, 96:
{2,3} {2,3} {2,3} {2,3} {2,3} {2,3} {2,3} {2,3}
{3,4} {3,4} {2,5} {2,9} {2,5} {2,9} {3,4}
{3,8} {3,5} {3,4} {3,4} {3,4} {3,8}
{5,6} {4,9} {3,5} {3,8} {3,16}
{2,15} {4,5} {4,9} {3,32}
{3,10} {5,6} {8,9}
{2,3,5} {2,15}
{3,10}
{3,20}
{4,15}
{5,12}
{2,3,5}
{3,4,5}
The version with 1's, empty sets, and singletons is
A225520.
The version for subsets of {1..n} is
A320426.
The version for strict partitions is
A337485.
The version for compositions is
A337697.
The version for prime indices is
A337984.
The maximal case with 1's is
A343652.
The version with empty sets is a(n) + 1.
The version with singletons is
A343654(n) - 1.
The version with empty sets and singletons is
A343654.
A018892 counts pairwise coprime unordered pairs of divisors.
A048691 counts pairwise coprime ordered pairs of divisors.
A048785 counts pairwise coprime ordered triples of divisors.
A051026 counts pairwise indivisible subsets of {1..n}.
A100565 counts pairwise coprime unordered triples of divisors.
A305713 counts pairwise coprime non-singleton strict partitions.
A343659 counts maximal pairwise coprime subsets of {1..n}.
Cf.
A007359,
A067824,
A074206,
A076078,
A084422,
A187106,
A285572,
A324837,
A326675,
A327516,
A338315.
A343660
Number of maximal pairwise coprime sets of at least two divisors > 1 of n.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 1, 0, 0, 2, 0, 2, 1, 1, 0, 3, 0, 1, 0, 2, 0, 4, 0, 0, 1, 1, 1, 4, 0, 1, 1, 3, 0, 4, 0, 2, 2, 1, 0, 4, 0, 2, 1, 2, 0, 3, 1, 3, 1, 1, 0, 8, 0, 1, 2, 0, 1, 4, 0, 2, 1, 4, 0, 6, 0, 1, 2, 2, 1, 4, 0, 4, 0, 1, 0, 8, 1, 1, 1
Offset: 1
The a(n) sets for n = 6, 12, 24, 30, 36, 60, 72, 96:
{2,3} {2,3} {2,3} {5,6} {2,3} {5,6} {2,3} {2,3}
{3,4} {3,4} {2,15} {2,9} {2,15} {2,9} {3,4}
{3,8} {3,10} {3,4} {3,10} {3,4} {3,8}
{2,3,5} {4,9} {3,20} {3,8} {3,16}
{4,15} {4,9} {3,32}
{5,12} {8,9}
{2,3,5}
{3,4,5}
The case with singletons is (also)
A343652.
The non-maximal version is
A343653.
The non-maximal version with 1's is
A343655.
The version for subsets of {2..n} is
A343659 (for n > 2).
A018892 counts coprime unordered pairs of divisors.
A051026 counts pairwise indivisible subsets of {1..n}.
A066620 counts pairwise coprime 3-sets of divisors.
A100565 counts pairwise coprime unordered triples of divisors.
Cf.
A005361,
A007359,
A007360,
A067824,
A074206,
A225520,
A276187,
A320426,
A325683,
A326077,
A326359,
A326496,
A337485,
A343654.
-
fasmax[y_]:=Complement[y,Union@@Most@*Subsets/@y];
Table[Length[fasmax[Select[Subsets[Rest[Divisors[n]]],CoprimeQ@@#&]]],{n,100}]
Comments