[go: up one dir, main page]

login
A060271
Difference between smallest prime following and largest prime preceding 2*(n-th prime).
0
2, 4, 4, 4, 6, 6, 4, 4, 6, 6, 6, 4, 6, 8, 4, 14, 14, 6, 10, 10, 6, 4, 6, 4, 12, 12, 12, 12, 4, 6, 6, 6, 4, 14, 14, 4, 14, 6, 10, 6, 8, 4, 6, 8, 4, 10, 6, 8, 4, 4, 12, 8, 4, 12, 18, 18, 6, 10, 6, 6, 10, 4, 12, 12, 10, 12, 4, 10, 10, 8, 10, 6, 8, 4, 8, 14, 10, 12, 10, 10, 14, 4, 14, 4, 4, 20, 8
OFFSET
2,1
EXAMPLE
n=1: p(1)=2, 2p(1)=4 is between 3 and 5, their difference is 2=a(1); n=6: p(6)=13, 2p(6)=26 is between 23 and 29 and their difference is 6=a(6).
MAPLE
with(numtheory): [seq(nextprime(2*ithprime(j))-prevprime(2*ithprime(j)), j=2...256)];
MATHEMATICA
dsplp[n_]:=Module[{np=2Prime[n]}, NextPrime[np]-NextPrime[np, -1]]; Array[ dsplp, 90, 2] (* Harvey P. Dale, Mar 20 2013 *)
KEYWORD
nonn
AUTHOR
Labos Elemer, Mar 23 2001
STATUS
approved