OFFSET
0,3
LINKS
Daniel Suteu, Table of n, a(n) for n = 0..10000
FORMULA
From Daniel Suteu, Jul 28 2019: (Start)
a(prime(n)) = A072205(n).
a(p^k) = (p^(2*k+1) + p + 2) / (2*(p+1)), for prime powers p^k.
a(n) = Sum_{k=1..n} gcd(m, k), where m = A095996(n).
a(n) = Sum_{k=1..n} f(n,k), where f(n,k) is the largest divisor d of k for which gcd(d, n) = 1. (End)
a(n) = Sum_{1<=k<=n, gcd(n,k)=1} phi(k)*floor(n/k). - Ridouane Oudra, May 24 2023
PROG
(PARI) a(n) = sum(k=1, n, if(gcd(n, k) == 1, k, denominator(n^k/k))); \\ Daniel Suteu, Jul 28 2019
(PARI) a(n) = sum(k=1, n, if(gcd(n, k) == 1, k, vecmax(select(d->gcd(d, n) == 1, divisors(k))))); \\ Daniel Suteu, Jul 28 2019
(PARI) a(n) = my(f=factor(n)[, 1]); sum(k=1, n, if(gcd(n, k) == 1, k, gcd(vector(#f, j, k / f[j]^valuation(k, f[j]))))); \\ Daniel Suteu, Jul 29 2019
(Magma) [0] cat [&+[Denominator(n^i/i):i in [1..n]]:n in [1..60]]; // Marius A. Burtea, Jul 29 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Dec 22 2016
STATUS
approved