The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A104197 Largest nonnegative integer r such that prime(n) + r and prime(n) - r are both prime. 1

%I #11 Mar 25 2019 03:50:51

%S 0,0,2,4,8,10,14,12,20,24,28,34,38,40,42,50,54,48,64,68,66,72,80,84,

%T 94,98,96,104,102,110,124,126,134,132,144,132,154,150,164,144,174,178,

%U 188,190,192,180,208,220,222,210,230,228,238,248,252,260,252,252,270

%N Largest nonnegative integer r such that prime(n) + r and prime(n) - r are both prime.

%C a(n) can be thought of as the radius of the largest 1-dimensional circle centered at prime(n) and consisting entirely of primes.

%H Amiram Eldar, <a href="/A104197/b104197.txt">Table of n, a(n) for n = 1..10000</a>

%e r = 4 is the largest nonnegative integer r such that prime(4) + 4 = 11 and prime(4) - 4 = 3 are both prime; so a(4) = 4.

%t a[p_] := Module[{k = p-3}, While[!PrimeQ[p+k] || !PrimeQ[p-k], k-=2]; k]; Join[{0}, a/@Select[Range[3, 1000], PrimeQ]] (* _Amiram Eldar_, Mar 24 2019 *)

%K easy,nonn

%O 1,3

%A _Joseph L. Pe_, Mar 12 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 12 22:30 EDT 2024. Contains 372497 sequences. (Running on oeis4.)