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
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
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
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Sep 20 2022
STATUS
approved