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!)
A256284 Smallest d > 0 such that both prime(n) - d and prime(n) + 2d are prime. 1
1, 3, 2, 4, 2, 6, 2, 4, 6, 8, 8, 10, 2, 6, 10, 6, 14, 6, 4, 12, 12, 10, 6, 8, 4, 2, 10, 2, 12, 18, 4, 6, 12, 12, 14, 8, 14, 16, 10, 6, 8, 10, 2, 16, 6, 14, 24, 28, 2, 4, 6, 8, 10, 6, 22, 6, 20, 8, 18, 12, 10, 26, 18, 2, 10, 14, 6, 10, 2, 22, 10, 8, 14, 20, 24, 6, 18, 4, 12, 10, 20, 30, 12, 20, 10, 6, 26 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,2
COMMENTS
Apparently a(n) exists for any n > 1.
Smallest primes p with corresponding values of even d are {p,d}: {7,2}, {11,4}, {17,6}, {31,8}, {41,10}, {73,12}, {61,14}, {167,16}, {127,18}, {271,20}, {263,22}, {223,24}, {307,26}, {227,28}, {431,30}, {919,32}, {941,34}, {857,36}, {877,38}.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 2..10000
EXAMPLE
a(3)=3 because p=prime(3)=5 and both 5-3 and 5+6 are prime.
a(5)=4 because p=prime(5)=11, and d cannot be 2 because 11-2 is not prime (and 11+4 is composite as well) while for d=4, both 11-4 and 11+8 are prime.
a(7)=6 because p=17, d cannot be 2 because both 17-2 and 17+4 are composite, d cannot be 4 because though 17-4 is prime but 17+8 is composite, finally d is 6 because both 17-6 and 17+12 are prime.
MATHEMATICA
s={3}; Do[p=Prime[k]; Do[If[PrimeQ[p-d]&&PrimeQ[p+2*d], s={s, d}; Break[]], {d, 2, p-3, 2}], {k, 4, 200}]; s=Flatten[s]
PROG
(PARI) a(n, p=prime(n))=my(q=p); while(q=precprime(q-1), if(isprime(3*p-2*q), return(p-q))); -1 \\ Charles R Greathouse IV, Jun 04 2015
CROSSREFS
Sequence in context: A099871 A157220 A304182 * A322979 A106288 A013633
KEYWORD
nonn
AUTHOR
Zak Seidov, Jun 03 2015
STATUS
approved

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 April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)