login
A280385
a(n) = Sum_{k=1..n} prime(k)^2*floor(n/prime(k)) .
0
0, 4, 13, 17, 42, 55, 104, 108, 117, 146, 267, 280, 449, 502, 536, 540, 829, 842, 1203, 1232, 1290, 1415, 1944, 1957, 1982, 2155, 2164, 2217, 3058, 3096, 4057, 4061, 4191, 4484, 4558, 4571, 5940, 6305, 6483, 6512, 8193, 8255, 10104, 10229, 10263, 10796, 13005, 13018, 13067, 13096, 13394, 13567, 16376, 16389, 16535
OFFSET
1,2
COMMENTS
Sum of all squares of prime divisors of all positive integers <= n.
Partial sums of A005063.
FORMULA
G.f.: (1/(1 - x))*Sum_{k>=1} prime(k)^2*x^prime(k)/(1 - x^prime(k)).
EXAMPLE
For n = 6 the prime divisors of the first six positive integers are {0}, {2}, {3}, {2}, {5}, {2, 3} so a(6) = 0^2 + 2^2 + 3^2 + 2^2 + 5^2 + 2^2 + 3^2 = 55.
MATHEMATICA
Table[Sum[Prime[k]^2 Floor[n/Prime[k]], {k, 1, n}], {n, 55}]
Table[Sum[DivisorSum[k, #1^2 &, PrimeQ[#1] &], {k, 1, n}], {n, 55}]
nmax = 55; Rest[CoefficientList[Series[(1/(1 - x)) Sum[Prime[k]^2 x^Prime[k]/(1 - x^Prime[k]), {k, 1, nmax}], {x, 0, nmax}], x]]
PROG
(PARI) a(n) = sum(k=1, n, prime(k)^2 * (n\prime(k))); \\ Indranil Ghosh, Apr 03 2017
(Python)
from sympy import prime
print([sum([prime(k)**2 * (n//prime(k)) for k in range(1, n + 1)]) for n in range(1, 21)]) # Indranil Ghosh, Apr 03 2017
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Jan 01 2017
STATUS
approved