OFFSET
1,3
LINKS
Danny Rorabaugh, Table of n, a(n) for n = 1..10000
FORMULA
Sequence A057660 gives the sum of the orders of the elements in a cyclic group with n elements so a(n) = floor(A057660(n) / n) = floor(Sum_{k=1..n} 1/GCD(n, k)) = floor(Sum of 1/d times phi(n/d)) for all divisors d of n, where phi is Euler's phi function. This sum may also be expressed as the product of (p^(2*e(p)+1)+1)/((p+1)*p^e(p)) over all prime divisors p of n where the canonical factorization of n is the product of p^e(p), the e(p) being the exponents of the power of p in the factorization.
From Amiram Eldar, Jul 25 2025: (Start)
a(n) = floor(sigma_2(n^2)/(n*sigma(n))) = floor(A001157(n^2)/(n*A000203(n^2))) = floor(A065827(n)/(n*A065764(n))).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = zeta(3)/zeta(2) (A253905). (End)
MAPLE
seq(floor(numtheory:-sigma[2](n^2)/numtheory:-sigma(n^2)/n), n=1..1000); # Robert Israel, Mar 24 2015
MATHEMATICA
f[n_] := Block[{i, j, k}, Reap@ For[j = 1, j <= n, j++, Sow[Floor[Sum[1/GCD[j, k], {k, 1, j}]]]]] // Flatten // Rest; f@ 49 (* Michael De Vlieger, Mar 24 2015 *)
a[n_] := Floor[DivisorSigma[2, n^2]/DivisorSigma[1, n^2]/n]; Array[a, 100] (* Amiram Eldar, Jul 25 2025 *)
PROG
(SageMath) [floor(sum([1/gcd(n, k) for k in range(1, n+1)])) for n in range(1, 50)] # Danny Rorabaugh, Mar 24 2015
(PARI) a(n) = {my(f = factor(n^2)); floor(sigma(f, 2)/(n * sigma(f))); } \\ Amiram Eldar, Jul 25 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Avi Peretz (njk(AT)netvision.net.il), Apr 01 2001
EXTENSIONS
Offset corrected and terms a(18)-a(50) added by Danny Rorabaugh, Mar 24 2015
STATUS
approved
