login
Number of semiprimes less than or equal to and not coprime to n.
4

%I #18 Apr 15 2023 06:21:55

%S 0,0,0,1,0,2,0,2,2,3,0,4,0,4,4,4,0,6,0,5,5,5,0,8,3,6,4,7,0,10,0,6,6,7,

%T 6,11,0,8,7,11,0,14,0,9,9,9,0,14,4,12,8,10,0,15,7,12,9,10,0,20,0,11,

%U 11,11,8,19,0,12,10,18,0,19,0,12,14,13,8,21,0,17,9,13,0,24,9,14,11,17,0,28,9

%N Number of semiprimes less than or equal to and not coprime to n.

%e a(10) = 3: four, six and ten are semiprimes; nine is a semiprime relatively prime to ten.

%o (PARI) a(n) = sum(k=1, n, if (bigomega(k) == 2, gcd(k,n) != 1)); \\ _Michel Marcus_, Apr 15 2023

%Y Cf. A000010, A001358, A144740.

%K easy,nonn

%O 1,6

%A _Reikku Kulon_, Sep 20 2008