OFFSET
1,1
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 1..10000
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)
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)
CROSSREFS
KEYWORD
nonn
AUTHOR
Patrick De Geest, Oct 15 1998
STATUS
approved