login
A034959
Divide even numbers into groups with prime(n) elements and add together.
5
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,1
LINKS
FORMULA
From Hieronymus Fischer, Sep 27 2012: (Start)
a(n) = 2*Sum_{k=(A007504(n-1)+1)..A007504(n)} (k-1), n > 1.
a(n) = (A007504(n) - A007504(n-1))*(A007504(n) + A007504(n-1) - 1), n > 1.
a(n) = 2*(A000217(A007504(n) - 1) - A000217(A007504(n-1) - 1)), n > 1.
If we define A007504(0):=0, then the formulas above are also true for n=1.
a(n) = 2*A034957(n).
a(n) = A034960(n) - A000040(n).
(End)
EXAMPLE
{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.
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Patrick De Geest, Oct 15 1998
STATUS
approved