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.

A316322 Sum of piles of first n primes: a(n) = Sum(prime(i)*(2*i-1): 1<=i<=n).

Original entry on oeis.org

2, 11, 36, 85, 184, 327, 548, 833, 1224, 1775, 2426, 3277, 4302, 5463, 6826, 8469, 10416, 12551, 15030, 17799, 20792, 24189, 27924, 32107, 36860, 42011, 47470, 53355, 59568, 66235, 73982, 82235, 91140, 100453, 110734, 121455, 132916, 145141, 158000, 171667, 186166, 201189, 217424, 234215, 251748
Offset: 1

Views

Author

N. J. A. Sloane, Jul 03 2018, based on Reinhard Zumkeller's A083215

Keywords

Examples

			............................................ 7
........................... 5 ............ 7 5 7
............ 3 .......... 5 3 5 ........ 7 5 3 5 7
2 ........ 3 2 3 ...... 5 3 2 3 5 .... 7 5 3 2 3 5 7
a(1)=2 ... a(2)=11 .... a(3)=36 ...... a(4)=85.
		

Crossrefs

Programs

  • Maple
    seq(add((2*i-1)*ithprime(i),i=1..n), n=1..80); # Ridouane Oudra, Feb 19 2025
  • Mathematica
    nxt[{n_, a_}] := {n + 1, a + Prime[n + 1] (2 n + 1)}; NestList[nxt,{1,2},50][[All,2]] (* Harvey P. Dale, Jul 05 2018 *)
  • PARI
    a(n) = sum(i=1, n, prime(i)*(2*i-1)); \\ Michel Marcus, Jan 22 2022

Formula

From Ridouane Oudra, Feb 19 2025: (Start)
a(n) = Sum_{i=1..n} Sum_{j=1..n} max(prime(i), prime(j)).
a(n) = 2*A014285(n) - A007504(n).
a(n) = 2*A167214(n) - A023662(n).
a(n) = A167214(n) + A062020(n). (End)