|
|
A089367
|
|
Smallest prime p such that np +1 is a prime, or 0 if no such prime exists.
|
|
1
|
|
|
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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
a(2n+1) = 0 if 4n+3 is composite. Conjecture: There are no other zeros.
|
|
LINKS
|
|
|
MAPLE
|
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
N:= 1000: # to get a(n) for n <= 2*N
count:= 0:
a:= Vector(2*N):
for i from 1 to 2*N do if isprime(2*i+1) then
a[i]:= 2;
if type(i, even) then count:= count+1 fi
fi od:
for p in select(isprime, [$3..N]) while count < N do
for q in select(isprime, [seq(2*p*i+1, i=1..N)]) do
n:= (q-1)/p;
if a[n] = 0 then a[n]:= p;
count:= count+1;
fi
od
od:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|