login
A332049
a(n) = (1/2) * Sum_{d|n, d > 1} d * phi(d).
3
0, 1, 3, 5, 10, 10, 21, 21, 30, 31, 55, 38, 78, 64, 73, 85, 136, 91, 171, 115, 150, 166, 253, 150, 260, 235, 273, 236, 406, 220, 465, 341, 388, 409, 451, 335, 666, 514, 549, 451, 820, 451, 903, 610, 640, 760, 1081, 598, 1050, 781, 955, 863, 1378, 820, 1165
OFFSET
1,3
COMMENTS
Sum of numerators of the reduced fractions 1/n, ..., (n-1)/n. Note that if n is a prime p this is p*(p-1)/2 as all fractions are already reduced. For 1/n, ..., n/n, see A057661.
LINKS
FORMULA
G.f.: (1/2) * Sum_{k>=2} phi(k^2) * x^k / (1 - x^k).
a(n) = Sum_{k=1..n-1} k / gcd(n,k).
a(n) = (sigma_2(n^2) - sigma_1(n^2)) / (2 * sigma_1(n^2)).
a(n) = Sum_{d|n, d > 1} A023896(d).
a(n) = A057661(n) - 1 = (A057660(n) - 1) / 2.
EXAMPLE
For n = 5, fractions are 1/5, 2/5, 3/5, 4/5, sum of numerators is 10.
For n = 8, fractions are 1/8, 1/4, 3/8, 1/2, 5/8, 3/4, 7/8, sum of numerators is 21.
MAPLE
N:= 100: # for a(1)..a(N)
V:= Vector(N):
for d from 2 to N do
v:= d*numtheory:-phi(d)/2;
R:= [seq(i, i=d..N, d)];
V[R]:= V[R] +~ v
od:
convert(V, list); # Robert Israel, Feb 07 2020
MATHEMATICA
Table[(1/2) Sum[If[d > 1, d EulerPhi[d], 0], {d, Divisors[n]}], {n, 1, 55}]
nmax = 55; CoefficientList[Series[(1/2) Sum[EulerPhi[k^2] x^k/(1 - x^k), {k, 2, nmax}], {x, 0, nmax}], x] // Rest
Table[Sum[k/GCD[n, k], {k, 1, n - 1}], {n, 1, 55}]
Table[(DivisorSigma[2, n^2] - DivisorSigma[1, n^2])/(2 DivisorSigma[1, n^2]), {n, 1, 55}]
PROG
(Magma) [0] cat [(1/2)*&+[ d*EulerPhi(d):d in Set(Divisors(n)) diff {1}]:n in [2..60]]; // Marius A. Burtea, Feb 07 2020
(PARI) a(n) = sumdiv(n, d, if (d>1, d*eulerphi(d)))/2; \\ Michel Marcus, Feb 07 2020
(Haskell)
toNums a = fmap (numerator . (% a))
toNumList a = toNums a [1..(a-1)]
sumList = sum . toNumList <$> [2..200]
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Feb 06 2020
STATUS
approved