

A166109


a(1)=5. For n >= 2, a(n) = the smallest prime p > a(n1) where neither p+1 nor p1 is divisible by any (earlier) term of this sequence.


1



5, 7, 17, 23, 37, 53, 157, 163, 173, 193, 227, 233, 257, 263, 283, 353, 383, 397, 457, 487, 523, 557, 563, 607, 677, 683, 733, 787, 823, 857, 863, 877, 947, 983, 997, 1033, 1097, 1117, 1153, 1187, 1193, 1237, 1277, 1283, 1297, 1307, 1423, 1433, 1447, 1453
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

This sequence would have terminated after only one term if a(1) equaled 2 or 3.


LINKS



EXAMPLE

a(5) = 37. So we want to look at the primes > 37 to get a(6). 41  1 is divisible by a(1)=5. (And 41+1 is divisible by a(2)=7.) 431 is divisible by a(2)=7. 471 is divisible by a(4)=23. By 531 is not divisible by any earlier terms of the sequence, and 53+1 is not divisible by any earlier terms of the sequence. So a(6) = 53.


MAPLE

Res:= 5: S:= 5: p:= 5:
count:= 1:
while count < 100 do
p:= nextprime(p);
if igcd((p+1)*(p1), S) = 1 then
count:= count+1; Res:= Res, p;
S:= S*p;
fi
od:


CROSSREFS



KEYWORD

nonn


AUTHOR



EXTENSIONS



STATUS

approved



