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

%I #16 Dec 07 2015 01:03:35

%S 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,

%T 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,

%U 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

%N Smallest d > 0 such that both prime(n) - d and prime(n) + 2d are prime.

%C Apparently a(n) exists for any n > 1.

%C 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}.

%H Charles R Greathouse IV, <a href="/A256284/b256284.txt">Table of n, a(n) for n = 2..10000</a>

%e a(3)=3 because p=prime(3)=5 and both 5-3 and 5+6 are prime.

%e 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.

%e 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.

%t 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]

%o (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

%K nonn

%O 2,2

%A _Zak Seidov_, Jun 03 2015

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 23 18:16 EDT 2024. Contains 371916 sequences. (Running on oeis4.)