login
A357251
a(n) = Sum_{1<=i<=j<=n} prime(i)*prime(j).
3
4, 19, 69, 188, 496, 1029, 2015, 3478, 5778, 9519, 14479, 21768, 31526, 43609, 59025, 79218, 105178, 135739, 173795, 219164, 271140, 333629, 406171, 491878, 594698, 711959, 842151, 988848, 1150168, 1330177, 1548617, 1791098, 2063454, 2359107, 2698231, 3064708, 3470396, 3918157, 4404795, 4938846
OFFSET
1,1
COMMENTS
a(n) is the sum of products of unordered pairs of (not necessarily distinct) elements from the first n primes.
It appears that 4 is the only square in the sequence.
LINKS
FORMULA
a(n) = (A007504(n)^2 + A024450(n))/2.
a(n) = A024447(n) + A024450(n).
a(n) = A065762(n)/2. - Hugo Pfoertner, Sep 24 2022
EXAMPLE
a(3) = 2*2 + 2*3 + 2*5 + 3*3 + 3*5 + 5*5 = 69.
MAPLE
P:= [seq(ithprime(i), i=1..100)]:
S:= ListTools:-PartialSums(P):
ListTools:-PartialSums(zip(`*`, P, S));
MATHEMATICA
Accumulate[(p = Prime[Range[40]]) * Accumulate[p]] (* Amiram Eldar, Sep 20 2022 *)
PROG
(Python)
from itertools import accumulate
from sympy import prime, primerange
def aupton(nn):
p = list(primerange(2, prime(nn)+1))
return list(accumulate(c*d for c, d in zip(p, accumulate(p))))
print(aupton(40)) # Michael S. Branicky, Sep 24 2022 after Amiram Eldar
CROSSREFS
Partial sums of A143215.
Row n=2 of A343751.
Sequence in context: A055485 A000306 A100185 * A291888 A217324 A129019
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Sep 20 2022
STATUS
approved