A034959 Divide even numbers into groups with prime(n) elements and add together.
2, 18, 70, 182, 484, 884, 1666, 2546, 4048, 6612, 8928, 13172, 17794, 22274, 28576, 37524, 48380, 57340, 71556, 85626, 98550, 118658, 138112, 163404, 196134, 224220, 249672, 281838, 310650, 347136, 420624, 467670, 525806, 571846, 655898
Offset: 1
Keywords
Examples
{0,2} #2 S=2; {4,6,8} #3 S=18; {10,12,14,16,18} #5 S=70; {20,22,24,26,28,30,32} #7 S=182.
Links
- Hieronymus Fischer, Table of n, a(n) for n = 1..10000
Programs
-
Python
from itertools import islice from sympy import nextprime def A034959_gen(): # generator of terms a, p = 0, 2 while True: yield p*((a<<1)+p-1) a, p = a+p, nextprime(p) A034959_list = list(islice(A034959_gen(),20)) # Chai Wah Wu, Mar 22 2023
Formula
From Hieronymus Fischer, Sep 27 2012: (Start)
If we define A007504(0):=0, then the formulas above are also true for n=1.
a(n) = 2*A034957(n).
(End)