login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Sum_{j=k(n)..prime(n)} j where k is the n-th nonprime nonnegative integer.
1

%I #8 Feb 11 2019 01:20:43

%S 3,6,9,13,38,55,108,124,185,330,376,550,671,736,897,1155,1470,1566,

%T 1927,2178,2266,2664,2958,3444,4158,4521,4653,5037,5215,5580,7182,

%U 7656,8418,8602,9999,10251,11128,12040,12597,13566,14570,14875,16683,16951,17612

%N Sum_{j=k(n)..prime(n)} j where k is the n-th nonprime nonnegative integer.

%e n k(n) prime(n) Sum_{j=k(n)..prime(n)} j

%e = ==== ======== ========================

%e 1 0 2 0 + 1 + 2 = 3 = a(1)

%e 2 1 3 1 + 2 + 3 = 6 = a(2)

%e 3 4 5 4 + 5 = 9 = a(3)

%e 4 6 7 6 + 7 = 13 = a(4)

%e 5 8 11 8 + 9 + 10 + 11 = 38 = a(5)

%o (PARI) k=0;p=2;for(i=1,1e2,s=p*(p+1)/2-k*(k-1)/2;print1(s",");p=nextprime(p+1);while(isprime(k++),))

%K nonn,base,easy

%O 1,1

%A _Juri-Stepan Gerasimov_, Jun 16 2009, Jun 27 2009

%E Corrected and extended by _Charles R Greathouse IV_, Mar 25 2010

%E Name clarified and Example section edited by _Jon E. Schoenfield_, Feb 10 2019