OFFSET
1,4
LINKS
FORMULA
a(p) = 1 for p prime.
From Wesley Ivan Hurt, Nov 21 2021: (Start)
If n is squarefree, then a(n) = omega(n).
a(p^k) = p for primes p and k >= 2. (End)
EXAMPLE
a(18) = Sum_{p|18} gcd(p,18/p) = gcd(2,9) + gcd(3,6) = 1 + 3 = 4.
MATHEMATICA
Table[Sum[GCD[k, n/k] (PrimePi[k] - PrimePi[k - 1]) (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}]
PROG
(PARI) a(n) = my(f=factor(n), p); sum(k=1, #f~, p=f[k, 1]; gcd(p, n/p)); \\ Michel Marcus, Jun 16 2021
(PARI) A345266(n) = vecsum(apply(p->gcd(p, n/p), factor(n)[, 1])); \\ Antti Karttunen, Nov 13 2021
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Wesley Ivan Hurt, Jun 13 2021
EXTENSIONS
Data section extended up to 105 terms by Antti Karttunen, Nov 13 2021
STATUS
approved