A121573 Prime-gap race; difference of the cumulative sums of gaps above and below prime(2n).
1, 3, 5, 7, 3, 1, 3, 3, 7, 5, 3, 5, 3, 1, 11, 13, 21, 25, 23, 23, 31, 33, 43, 35, 37, 33, 29, 29, 33, 31, 35, 33, 43, 47, 49, 51, 51, 53, 49, 51, 59, 63, 65, 61, 63, 59, 63, 65, 55, 43, 39, 35, 39, 39, 43, 41, 51, 43, 45, 41, 33, 35, 33, 31, 31, 35, 33, 29, 25, 15, 7, 5, 9, 7, 17, 15, 31, 35, 33, 35, 43, 45, 47, 53, 55, 63, 67, 59, 51, 63, 61
Offset: 1
Examples
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.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- T. D. Noe, Plot of 10^6 terms
Programs
-
Haskell
a121573 n = a121573_list !! (n-1) a121573_list = scanl1 (+) $ map a036263 [1, 3 ..] -- Reinhard Zumkeller, Aug 02 2012
-
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 *)
Formula
Extensions
Typo in Formula fixed by Reinhard Zumkeller, Aug 02 2012
Comments