OFFSET
1,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
Additive with a(p^e) = 0 if p = 2, p^2 otherwise.
G.f.: Sum_{k>=2} prime(k)^2*x^prime(k)/(1 - x^prime(k)). - Ilya Gutkovskiy, Jan 04 2017
From Antti Karttunen, Jul 10 & 11 2017: (Start)
(End)
MATHEMATICA
Table[Total[Select[Divisors[n], OddQ[#]&&PrimeQ[#]&]^2], {n, 60}] (* Harvey P. Dale, May 02 2012 *)
Array[DivisorSum[#, #^2 &, And[PrimeQ@ #, OddQ@ #] &] &, 74] (* Michael De Vlieger, Jul 11 2017 *)
f[2, e_] := 0; f[p_, e_] := p^2; a[n_] := Plus @@ f @@@ FactorInteger[n]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 20 2022 *)
PROG
(PARI) a(n) = sumdiv(n, d, ((d%2) && isprime(d))*d^2); \\ Michel Marcus, Jan 04 2017
(Scheme) (define (A005066 n) (cond ((= 1 n) 0) ((even? n) (A005066 (/ n 2))) (else (+ (A000290 (A020639 n)) (A005066 (A028234 n)))))) ;; Antti Karttunen, Jul 10 2017
(Python)
from sympy import primefactors
def a(n): return sum(p**2 for p in primefactors(n) if p % 2)
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jul 11 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Antti Karttunen, Jul 10 2017
STATUS
approved