This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A332049 #34 Dec 09 2023 01:43:27 %S A332049 0,1,3,5,10,10,21,21,30,31,55,38,78,64,73,85,136,91,171,115,150,166, %T A332049 253,150,260,235,273,236,406,220,465,341,388,409,451,335,666,514,549, %U A332049 451,820,451,903,610,640,760,1081,598,1050,781,955,863,1378,820,1165 %N A332049 a(n) = (1/2) * Sum_{d|n, d > 1} d * phi(d). %C A332049 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. %H A332049 Robert Israel, <a href="/A332049/b332049.txt">Table of n, a(n) for n = 1..10000</a> %F A332049 G.f.: (1/2) * Sum_{k>=2} phi(k^2) * x^k / (1 - x^k). %F A332049 a(n) = Sum_{k=1..n-1} k / gcd(n,k). %F A332049 a(n) = (sigma_2(n^2) - sigma_1(n^2)) / (2 * sigma_1(n^2)). %F A332049 a(n) = Sum_{d|n, d > 1} A023896(d). %F A332049 a(n) = A057661(n) - 1 = (A057660(n) - 1) / 2. %e A332049 For n = 5, fractions are 1/5, 2/5, 3/5, 4/5, sum of numerators is 10. %e A332049 For n = 8, fractions are 1/8, 1/4, 3/8, 1/2, 5/8, 3/4, 7/8, sum of numerators is 21. %p A332049 N:= 100: # for a(1)..a(N) %p A332049 V:= Vector(N): %p A332049 for d from 2 to N do %p A332049 v:= d*numtheory:-phi(d)/2; %p A332049 R:= [seq(i,i=d..N,d)]; %p A332049 V[R]:= V[R] +~ v %p A332049 od: %p A332049 convert(V,list); # _Robert Israel_, Feb 07 2020 %t A332049 Table[(1/2) Sum[If[d > 1, d EulerPhi[d], 0], {d, Divisors[n]}], {n, 1, 55}] %t A332049 nmax = 55; CoefficientList[Series[(1/2) Sum[EulerPhi[k^2] x^k/(1 - x^k), {k, 2, nmax}], {x, 0, nmax}], x] // Rest %t A332049 Table[Sum[k/GCD[n, k], {k, 1, n - 1}], {n, 1, 55}] %t A332049 Table[(DivisorSigma[2, n^2] - DivisorSigma[1, n^2])/(2 DivisorSigma[1, n^2]), {n, 1, 55}] %o A332049 (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 %o A332049 (PARI) a(n) = sumdiv(n, d, if (d>1, d*eulerphi(d)))/2; \\ _Michel Marcus_, Feb 07 2020 %o A332049 (Haskell) %o A332049 toNums a = fmap (numerator . (% a)) %o A332049 toNumList a = toNums a [1..(a-1)] %o A332049 sumList = sum . toNumList <$> [2..200] %Y A332049 Cf. A000010, A002618, A006579, A023896, A057660, A057661. %K A332049 nonn,look %O A332049 1,3 %A A332049 _Ilya Gutkovskiy_, Feb 06 2020