OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
a(n) = phi(n) * Sum_{p|n} p/(p-1), where p is prime. - Ridouane Oudra, Feb 03 2023
a(n) = Sum_{d|n, d is a prime power} A020639(d)*phi(n/d). - Ridouane Oudra, Feb 13 2023
a(n) = Sum_{p|n, p prime} p^v(n,p)*phi(n/p^v(n,p)), where p^v(n,p) is the highest power of p dividing n. - Ridouane Oudra, Oct 06 2023
EXAMPLE
The integers k, 2 <= k <= 12, where gcd(k,12) is a power of a prime are 2,3,4,8,9 and 10. gcd(2,12) = 2^1, gcd(3,12) = 3^1, gcd(4,12) = 2^2, gcd(8, 12) = 2^2, gcd(9,12) = 3^1 and gcd(10,12) = 2^1. The sum of the prime bases of the prime-powers is 2+3+2+2+3+2 = 14. So a(12) = 14.
MAPLE
with(numtheory): a:= proc(n) local k, m := 0; for k from 2 to n do if nops(factorset(gcd(n, k))) = 1 then m:= m + factorset(gcd(n, k))[1]; end if; end do; return m; end proc: seq(a(n), n=1..80); # Ridouane Oudra, Feb 03 2023
MATHEMATICA
f[n_] := Plus @@ First /@ Flatten[Select[FactorInteger[GCD[Range[n], n]], Length[ # ] == 1 &], 1]; Table[f[n], {n, 80}] (* Ray Chandler, Sep 06 2006 *)
PROG
(PARI) A122411(n) = { my(p=0); sum(k=2, n, if(isprimepower(gcd(n, k), &p), p, 0)); }; \\ Antti Karttunen, Feb 25 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Sep 02 2006
EXTENSIONS
Corrected and extended by Ray Chandler, Sep 06 2006
STATUS
approved