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!)
A089367 Smallest prime p such that np +1 is a prime, or 0 if no such prime exists. 1

%I #11 May 26 2014 04:35:46

%S 2,2,2,3,2,2,0,2,2,3,2,3,0,2,2,7,0,2,0,2,2,3,2,3,0,2,0,7,2,2,0,3,2,3,

%T 2,2,0,5,2,7,2,3,0,2,0,3,0,2,0,2,2,3,2,2,0,2,0,19,0,3,0,5,2,3,2,3,0,2,

%U 2,3,0,13,0,2,2,3,0,2,0,3,2,19,2,5,0,2,0,7,2,2,0,3,0,3,2,2,0,2,2,7,0,3,0,3

%N Smallest prime p such that np +1 is a prime, or 0 if no such prime exists.

%C a(2n+1) = 0 if 4n+3 is composite. Conjecture: There are no other zeros.

%H Robert Israel, <a href="/A089367/b089367.txt">Table of n, a(n) for n = 1..20000</a>

%p for n from 1 to 245 do if(n mod 2 =1 and not isprime(2*n+1)) then a[n]:=0: else i:=1:while(not isprime(n*ithprime(i)+1)) do i:=i+1:od: a[n]:=ithprime(i):fi:od:seq(a[j],j=1..245); # _Sascha Kurz_, May 09 2004

%p N:= 1000: # to get a(n) for n <= 2*N

%p count:= 0:

%p a:= Vector(2*N):

%p for i from 1 to 2*N do if isprime(2*i+1) then

%p a[i]:= 2;

%p if type(i,even) then count:= count+1 fi

%p fi od:

%p for p in select(isprime,[$3..N]) while count < N do

%p for q in select(isprime,[seq(2*p*i+1,i=1..N)]) do

%p n:= (q-1)/p;

%p if a[n] = 0 then a[n]:= p;

%p count:= count+1;

%p fi

%p od

%p od:

%p A089367:= [seq(a[i],i=1..2*N)]; # _Robert Israel_, May 26 2014

%K nonn

%O 1,1

%A _Amarnath Murthy_, Nov 08 2003

%E More terms from _Sascha Kurz_, May 09 2004

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 24 06:07 EDT 2024. Contains 371918 sequences. (Running on oeis4.)