login
Let S(n) be the set of all positive integers that are <= n and are coprime to n. a(n) = the number of members of S(n) that are each coprime to every other member of S(n).
2

%I #14 Jun 24 2024 22:27:52

%S 1,1,2,2,2,2,2,4,3,2,2,4,3,4,3,4,3,6,4,6,5,4,4,8,5,5,4,6,4,8,5,8,6,6,

%T 5,8,5,7,5,7,5,10,6,9,7,8,6,12,7,10,7,9,7,13,8,10,8,8,7,14,8,10,8,11,

%U 8,13,8,12,9,11,9,15,10,12,10,13,10,16,10,14,11,13,10,18,11,14,10,14,10,20

%N Let S(n) be the set of all positive integers that are <= n and are coprime to n. a(n) = the number of members of S(n) that are each coprime to every other member of S(n).

%C A164296(n) + A164297(n) = phi(n) (= A000010(n) = the number of elements in S(n)).

%H Reinhard Zumkeller, <a href="/A164296/b164296.txt">Table of n, a(n) for n = 1..1000</a>

%e The positive integers that are <= 9 and are coprime to 9 are: 1,2,4,5, 7,8. 1 is coprime to each other member in S(9). While 2, 4, and 8 are non-coprime to each other. 5 is coprime to each other member of S(9). And 7 is also coprime to each other member. Since there are 3 integers in S(9) that are coprime to each other member -- these integers being 1, 5, and 7 -- then a(9) = 3.

%o (Haskell)

%o import Data.List ((\\))

%o a164296 n = length [m | let ts = a038566_row n, m <- ts,

%o all ((== 1) . gcd m) (ts \\ [m])]

%o -- _Reinhard Zumkeller_, May 28 2015

%Y Cf. A164297.

%Y Cf. A038566, A000010.

%K nonn

%O 1,3

%A _Leroy Quet_, Aug 12 2009

%E Extended by _Ray Chandler_, Mar 16 2010