OFFSET
1,2
COMMENTS
The set of these terms apart from 0 is A048261. - Bernard Schott, Feb 10 2022
Inverse Möbius transform of n^2 * c(n), where c(n) is the prime characteristic (A010051). - Wesley Ivan Hurt, Jun 22 2024
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
Additive with a(p^e) = p^2.
G.f.: Sum_{k>=1} prime(k)^2*x^prime(k)/(1 - x^prime(k)). - Ilya Gutkovskiy, Dec 24 2016
From Antti Karttunen, Jul 11 2017: (Start)
(End)
Dirichlet g.f.: primezeta(s-2)*zeta(s). - Benedict W. J. Irwin, Jul 11 2018
a(n) = Sum_{p|n, p prime} p^2. - Wesley Ivan Hurt, Feb 04 2022
a(n) = Sum_{d|n} d^2 * c(d), where c = A010051. - Wesley Ivan Hurt, Jun 22 2024
MAPLE
A005063 := proc(n)
add(d^2, d= numtheory[factorset](n)) ;
end proc;
seq(A005063(n), n=1..40) ; # R. J. Mathar, Nov 08 2011
MATHEMATICA
a[n_] := Total[FactorInteger[n][[All, 1]]^2]; a[1]=0; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Mar 20 2017 *)
Array[DivisorSum[#, #^2 &, PrimeQ] &, 61] (* Michael De Vlieger, Jul 11 2017 *)
PROG
(PARI) a(n)=local(fm, t); fm=factor(n); t=0; for(k=1, matsize(fm)[1], t+=fm[k, 1]^2); t \\ Franklin T. Adams-Watters, May 03 2009
(PARI) a(n) = vecsum(apply(x->x^2, factor(n)[, 1])); \\ Michel Marcus, Sep 19 2020
(Scheme) (define (A005063 n) (if (= 1 n) 0 (+ (A000290 (A020639 n)) (A005063 (A028234 n))))) ;; Antti Karttunen, Jul 10 2017
(Python)
from sympy import primefactors
def a(n): return sum(p**2 for p in primefactors(n))
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jul 11 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Franklin T. Adams-Watters, May 03 2009
STATUS
approved