OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
FORMULA
If p is prime, a(p) = Sum_{k=1..p} k^floor(1/gcd(p,k)) = 1^1 + ... + (p-1)^1 + p^0 = p*(p-1)/2 + 1.
a(1) = 1, a(n) = n + (n-2)*phi(n)/2 for n >= 2. - Wesley Ivan Hurt, Nov 24 2021
EXAMPLE
a(6) = Sum_{k=1..6} k^floor(1/gcd(6,k)) = 1^1 + 2^0 + 3^0 + 4^0 + 5^1 + 6^0 = 1 + 1 + 1 + 1 + 5 + 1 = 10.
MATHEMATICA
Table[Sum[k^Floor[1/GCD[n, k]], {k, n}], {n, 80}]
PROG
(PARI) A345091(n) = if(1==n, n, n + ((n-2)*eulerphi(n)/2)); \\ Antti Karttunen, Nov 25 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Jun 07 2021
STATUS
approved