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”).

A031167
a(n) = prime(n+5) - prime(n).
11
11, 14, 14, 16, 18, 18, 20, 22, 20, 18, 22, 22, 20, 24, 24, 20, 20, 22, 22, 26, 28, 24, 24, 20, 16, 26, 28, 30, 30, 36, 24, 26, 26, 28, 24, 28, 24, 28, 26, 24, 20, 30, 32, 34, 32, 34, 28, 18, 24, 28, 30, 30, 30, 26, 24, 20, 24, 36, 34, 32, 34, 38, 30, 36, 36, 36, 28
OFFSET
1,1
LINKS
MAPLE
seq(ithprime(n+5)-ithprime(n), n=1..30);
MATHEMATICA
a=5; t=Array[Prime, 123]; Drop[t, a]-Drop[t, -a] (* Vladimir Joseph Stephan Orlovsky, Aug 13 2009 *)
Last[#]-First[#]&/@Partition[Prime[Range[80]], 6, 1] (* Harvey P. Dale, Jul 11 2014 *)
PROG
(PARI) A031167(n) = prime(n+5)-prime(n)
(Magma) [NthPrime(n+5)-NthPrime(n): n in [1..100] ]; // Vincenzo Librandi, Apr 23 2011
(Haskell)
a031167 n = a031167_list !! (n-1)
a031167_list = zipWith (-) (drop 5 a000040_list) a000040_list
-- Reinhard Zumkeller, Aug 23 2015
KEYWORD
nonn
AUTHOR
EXTENSIONS
Initial term added by Michael B. Porter, Jan 27 2010
STATUS
approved