cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A357251 a(n) = Sum_{1<=i<=j<=n} prime(i)*prime(j).

Original entry on oeis.org

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

Views

Author

J. M. Bergot and Robert Israel, Sep 20 2022

Keywords

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.

Examples

			a(3) = 2*2 + 2*3 + 2*5 + 3*3 + 3*5 + 5*5 = 69.
		

Crossrefs

Partial sums of A143215.
Row n=2 of A343751.

Programs

  • 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 *)
  • 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

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