%I #68 May 30 2024 00:35:57
%S 1,2,3,5,7,13,17,33,45,73,103,205,253,505,733,1133,1529,3057,3897,
%T 7793,10241,16513,24593,49185,59265,109297,163369,262489,355729,
%U 711457,879937,1759873,2360641,3908545,5858113,10534337,12701537,25403073,38090337,63299265,81044097,162088193,205482593,410965185,570487233,855676353
%N Number of primitive subsequences of {1, 2, ..., n}.
%C a(n) counts all subsequences of {1, ..., n} in which no term divides any other. If n is a prime a(n) = 2*a(n-1)-1 because for each subsequence s counted by a(n-1) two different subsequences are counted by a(n): s and s,n. There is only one exception: 1,n is not a primitive subsequence because 1 divides n. For all n>1: a(n) < 2*a(n-1). - _Alois P. Heinz_, Mar 07 2011
%C Maximal primitive subsets are counted by A326077. - _Gus Wiseman_, Jun 07 2019
%D Blanchet-Sadri, Francine. Algorithmic combinatorics on partial words. Chapman & Hall/CRC, Boca Raton, FL, 2008. ii+385 pp. ISBN: 978-1-4200-6092-8; 1-4200-6092-9 MR2384993 (2009f:68142). See p. 320. - _N. J. A. Sloane_, Apr 06 2012
%H Juliana Couras, Ricardo Jesus, and Tomás Oliveira e Silva, <a href="/A051026/b051026.txt">Table of n, a(n) for n = 0..800</a> (terms up to n=80 from Alois P. Heinz)
%H Marcel K. Goh and Jonah Saks, <a href="https://arxiv.org/abs/2206.12535">Alternating-sum statistics for certain sets of integers</a>, arXiv:2206.12535 [math.CO], 2022.
%H Nathan McNew, <a href="http://arxiv.org/abs/1808.04923">Counting primitive subsets and other statistics of the divisor graph of {1,2,..,n}</a>, arXiv:1808.04923 [math.NT], 2018.
%H Richárd Palincza, <a href="https://repozitorium.omikk.bme.hu/items/ba640e7b-ba77-48eb-a9e2-d60f1b01e5dd">Counting type and extremal problems from Arithmetic Combinatorics</a>, Ph. D. Thesis, Budapest Univ. Tech. Econ. (Hungary, 2024).
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimitiveSequence.html">Primitive Sequence</a>
%e a(4) = 7, the primitive subsequences (including the empty sequence) are: (), (1), (2), (3), (4), (2,3), (3,4).
%e a(5) = 13 = 2*7-1, the primitive subsequences are: (), (5), (1), (2), (2,5), (3), (3,5), (4), (4,5), (2,3), (2,3,5), (3,4), (3,4,5).
%e From _Gus Wiseman_, Jun 07 2019: (Start)
%e The a(0) = 1 through a(5) = 13 primitive (pairwise indivisible) subsets:
%e {} {} {} {} {} {}
%e {1} {1} {1} {1} {1}
%e {2} {2} {2} {2}
%e {3} {3} {3}
%e {2,3} {4} {4}
%e {2,3} {5}
%e {3,4} {2,3}
%e {2,5}
%e {3,4}
%e {3,5}
%e {4,5}
%e {2,3,5}
%e {3,4,5}
%e a(n) is also the number of subsets of {1..n} containing all of their pairwise products <= n as well as any quotients of divisible elements. For example, the a(0) = 1 through a(5) = 13 subsets are:
%e {} {} {} {} {} {}
%e {1} {1} {1} {1} {1}
%e {1,2} {1,2} {1,3} {1,3}
%e {1,3} {1,4} {1,4}
%e {1,2,3} {1,2,4} {1,5}
%e {1,3,4} {1,2,4}
%e {1,2,3,4} {1,3,4}
%e {1,3,5}
%e {1,4,5}
%e {1,2,3,4}
%e {1,2,4,5}
%e {1,3,4,5}
%e {1,2,3,4,5}
%e Also the number of subsets of {1..n} containing all of their multiples <= n. For example, the a(0) = 1 through a(5) = 13 subsets are:
%e {} {} {} {} {} {}
%e {1} {2} {2} {3} {3}
%e {1,2} {3} {4} {4}
%e {2,3} {2,4} {5}
%e {1,2,3} {3,4} {2,4}
%e {2,3,4} {3,4}
%e {1,2,3,4} {3,5}
%e {4,5}
%e {2,3,4}
%e {2,4,5}
%e {3,4,5}
%e {2,3,4,5}
%e {1,2,3,4,5}
%e (End)
%e From _Gus Wiseman_, Mar 12 2024: (Start)
%e Also the number of subsets of {1..n} containing all divisors of the elements. For example, the a(0) = 1 through a(6) = 17 subsets are:
%e {} {} {} {} {} {}
%e {1} {1} {1} {1} {1}
%e {1,2} {1,2} {1,2} {1,2}
%e {1,3} {1,3} {1,3}
%e {1,2,3} {1,2,3} {1,5}
%e {1,2,4} {1,2,3}
%e {1,2,3,4} {1,2,4}
%e {1,2,5}
%e {1,3,5}
%e {1,2,3,4}
%e {1,2,3,5}
%e {1,2,4,5}
%e {1,2,3,4,5}
%e (End)
%p with(numtheory):
%p b:= proc(s) option remember; local n;
%p n:= max(s[]);
%p `if`(n<0, 1, b(s minus {n}) + b(s minus divisors(n)))
%p end:
%p bb:= n-> b({$2..n} minus divisors(n)):
%p sb:= proc(n) option remember; `if`(n<2, 0, bb(n) + sb(n-1)) end:
%p a:= n-> `if`(n=0, 1, `if`(isprime(n), 2*a(n-1)-1, 2+sb(n))):
%p seq(a(n), n=0..40); # _Alois P. Heinz_, Mar 07 2011
%t b[s_] := b[s] = With[{n=Max[s]}, If[n < 0, 1, b[Complement[s, {n}]] + b[Complement[s, Divisors[n]]]]];
%t bb[n_] := b[Complement[Range[2, n], Divisors[n]]];
%t sb[n_] := sb[n] = If[n < 2, 0, bb[n] + sb[n-1]];
%t a[n_] := If[n == 0, 1, If[PrimeQ[n], 2a[n-1] - 1, 2 + sb[n]]]; Table[a[n], {n, 0, 37}]
%t (* _Jean-François Alcover_, Jul 27 2011, converted from Maple *)
%t Table[Length[Select[Subsets[Range[n]], SubsetQ[#,Select[Union@@Table[#*i,{i,n}],#<=n&]]&]],{n,10}] (* _Gus Wiseman_, Jun 07 2019 *)
%t Table[Length[Select[Subsets[Range[n]], #==Union@@Divisors/@#&]],{n,0,10}] (* _Gus Wiseman_, Mar 12 2024 *)
%Y Cf. A007865, A054519, A096827, A103580, A303362, A305148.
%Y Cf. A326023, A326076, A326077, A326081, A326082, A326083, A326117.
%Y Cf. A037031, A051026, A355740, A368110, A370585.
%K nonn,nice
%O 0,2
%A _Eric W. Weisstein_
%E More terms from _David Wasserman_, May 02 2002
%E a(32)-a(37) from _Donovan Johnson_, Aug 11 2010