OFFSET
1,2
COMMENTS
This sequence was inspired by seeing two lines in the plot of A008347. It was expected that, on average, the gaps above prime(2n) would be larger than the gaps below prime(2n) and hence a(n) would be a mostly positive sequence. With some exceptions, this is true for the first 6330 terms. However, as the plot shows, over 500000 negative terms follow!
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
T. D. Noe, Plot of 10^6 terms
FORMULA
EXAMPLE
a(6)=1 because the prime gaps above and below the even-indexed primes (3,7,13,19,29,37) are 2,4,4,4,2,4 and 1,2,2,2,6,6, respectively. The sums of these gaps are 20 and 19, which differ by 1.
MATHEMATICA
s=0; Table[s=s+Prime[2n-1]+Prime[2n+1]-2*Prime[2n], {n, 115}]
With[{g=Transpose[Differences/@Partition[Prime[Range[400]], 3, 2]]}, Accumulate[g[[2]]]-Accumulate[g[[1]]]](* Harvey P. Dale, May 28 2013 *)
PROG
(Haskell)
a121573 n = a121573_list !! (n-1)
a121573_list = scanl1 (+) $ map a036263 [1, 3 ..]
-- Reinhard Zumkeller, Aug 02 2012
CROSSREFS
KEYWORD
AUTHOR
T. D. Noe, Aug 08 2006
EXTENSIONS
Typo in Formula fixed by Reinhard Zumkeller, Aug 02 2012
STATUS
approved