OFFSET
1,2
COMMENTS
Compare the definition of a(n) to phi(n) = number of integers in {1, 2, ..., n} that are coprime to n.
FORMULA
a(n) = Sum_{d|n} mu(d)*floor(sigma(n)/d). - Ridouane Oudra, May 12 2024
EXAMPLE
There are four numbers in {1, 2, ..., sigma(4) = 7} that are coprime to 4, i.e. 1, 3, 5, 7. Hence a(4) = 4.
MAPLE
with(numtheory): seq(add(mobius(d)*floor(sigma(n)/d), d in divisors(n)), n=1..100) ; # Ridouane Oudra, May 12 2024
MATHEMATICA
h[n_] := Module[{l}, l = {}; For[i = 1, i <= DivisorSigma[1, n], i++, If[GCD[i, n] == 1, l = Append[l, i]]]; l]; Table[Length[h[i]], {i, 1, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Oct 04 2002
STATUS
approved