|
|
A276187
|
|
Number of subsets of {1,..,n} of cardinality >= 2 such that the elements of each counted subset are pairwise coprime.
|
|
11
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
n is prime if and only if a(n) = 2*a(n-1)+n-1. - Robert Israel, Aug 24 2016
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
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)
|
|
MAPLE
|
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:
|
|
MATHEMATICA
|
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&]]];
|
|
PROG
|
(Sage)
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)
(PARI) f(n, k=1)=if(n==1, return(2)); if(gcd(k, n)==1, f(n-1, n*k)) + f(n-1, k)
|
|
CROSSREFS
|
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.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|