login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A046930
Size of sea of composite numbers surrounding n-th prime.
7
1, 1, 2, 4, 4, 4, 4, 4, 8, 6, 6, 8, 4, 4, 8, 10, 6, 6, 8, 4, 6, 8, 8, 12, 10, 4, 4, 4, 4, 16, 16, 8, 6, 10, 10, 6, 10, 8, 8, 10, 6, 10, 10, 4, 4, 12, 22, 14, 4, 4, 8, 6, 10, 14, 10, 10, 6, 6, 8, 4, 10, 22, 16, 4, 4, 16, 18, 14, 10, 4, 8, 12, 12, 10, 8, 8, 12, 10, 10, 16, 10, 10, 10, 6, 8, 8
OFFSET
1,3
FORMULA
a(n) = A031131(n) - 2 for n > 1. - Reinhard Zumkeller, Dec 19 2013
EXAMPLE
23 is in a sea of 8 composites: 20,21,22,23,24,25,26,27,28.
MAPLE
[ seq(ithprime(i)-ithprime(i-2)-2, i=3..100) ];
MATHEMATICA
Table[ Prime[n + 2] - Prime[n] - 2, {n, 75}] (* Robert G. Wilson v Oct 27 2004 *)
Join[{1}, #[[3]]-#[[1]]-2&/@Partition[Prime[Range[90]], 3, 1]] (* Harvey P. Dale, Sep 26 2012 *)
PROG
(Haskell)
a046930 1 = 1
a046930 n = subtract 2 $ a031131 n -- Reinhard Zumkeller, Dec 19 2013
CROSSREFS
KEYWORD
nonn,easy,nice
EXTENSIONS
More terms from Michel ten Voorde
STATUS
approved