OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
EXAMPLE
The positive integers k, k <= 12, where gcd(k,12) = a power of a prime, are 1, 2, 3, 4, 8, 9 and 10; gcd(1,12) = p^0, 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 exponents raising the primes is 0+1+1+2+2+1+1 = 8. So a(12) = 8.
MATHEMATICA
f[n_] := Plus @@ Last /@ Flatten[Select[FactorInteger[GCD[Range[n], n]], Length[ # ] == 1 &], 1]; Table[f[n], {n, 80}] (* Ray Chandler, Sep 06 2006 *)
PROG
(PARI) A122410(n) = sum(k=1, n, isprimepower(gcd(n, k))); \\ Antti Karttunen, Feb 25 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Sep 02 2006
EXTENSIONS
Extended by Ray Chandler, Sep 06 2006
STATUS
approved