OFFSET
1,3
COMMENTS
Number of positive squarefree numbers <= n that are relatively prime to n.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Steven R. Finch, Unitarism and infinitarism.
Steven R. Finch, Unitarism and Infinitarism, February 25, 2004. [Cached copy, with permission of the author]
Steven R. Finch, Mathematical Constants II, Encyclopedia of Mathematics and Its Applications, Cambridge University Press, Cambridge, 2018, p. 49-50.
FORMULA
Let s(n) = Sum_{k=1..n} a(k). Then s(n) is asymptotic to C*n^2 where C = (3/Pi^2)*alpha and alpha = Product_{p prime} (1 - 1/(p*(p+1))) = A065463 = 0.7044422009... [From discussions in Number Theory List, Apr 06 2004]
a(n) = Sum_{i=1..n} mu(A007947(n)*i)^2, where mu is the Moebius function (A008683). - Ridouane Oudra, Jul 27 2019
a(n) = Sum_{1<=k<=n, gcd(n,k)=1} mu(k)^2. - Ridouane Oudra, May 25 2023
EXAMPLE
n=15, there are A000010(15)=8 residues: 1, 2, 4=2^2, 7, 8=2^3, 11, 13 and 14; six of them are squarefree: 1, 2, 7, 11, 13 and 14, therefore a(15)=6. [Typo fixed by Reinhard Zumkeller, Mar 19 2010]
MAPLE
with(numtheory): rad := n -> mul(p, p in factorset(n)):
seq(add(mobius(rad(n)*i)^2, i=1..n), n=1..100); # Ridouane Oudra, Jul 27 2019
MATHEMATICA
a[n_] := Select[Range[n], SquareFreeQ[#] && CoprimeQ[#, n]&] // Length;
Array[a, 100] (* Jean-François Alcover, Dec 12 2021 *)
PROG
(Haskell)
a073311 = sum . map a008966 . a038566_row
-- Reinhard Zumkeller, Jul 04 2012
(PARI) a(n)=my(s=1); forfactored(k=2, n-1, if(vecmax(k[2][, 2])==1 && gcd(k[1], n)==1, s++)); s \\ Charles R Greathouse IV, Nov 05 2017
(Magma) [&+[MoebiusMu(&*PrimeDivisors(k)*i)^2:i in [1..k]]: k in [1..65]]; // Marius A. Burtea, Jul 27 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 25 2002
STATUS
approved