OFFSET
1,2
FORMULA
Sum_{k=1..n} a(k) = A018806(n).
G.f.: Sum_{k>=1} phi(k) * x^k * (1 + x^k)/(1 - x^k)^2.
Conjecture: a(n) = Sum_{k = 1..2*n} (-1)^k * gcd(k, 4*n). Cf. A344372. - Peter Bala, Jan 01 2024
MATHEMATICA
a[n_] := Sum[EulerPhi[k] * First @ Differences @ (Quotient[{n - 1, n}, k]^2), {k, 1, n}]; Array[a, 50] (* Amiram Eldar, May 24 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, eulerphi(k)*((n\k)^2-((n-1)\k)^2));
(PARI) my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, eulerphi(k)*x^k*(1+x^k)/(1-x^k)^2))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, May 24 2021
STATUS
approved