[go: up one dir, main page]

login
A166109
a(1)=5. For n >= 2, a(n) = the smallest prime p > a(n-1) where neither p+1 nor p-1 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
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.) 43-1 is divisible by a(2)=7. 47-1 is divisible by a(4)=23. By 53-1 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)*(p-1), S) = 1 then
count:= count+1; Res:= Res, p;
S:= S*p;
fi
od:
Res; # Robert Israel, Jun 16 2019
CROSSREFS
Sequence in context: A191145 A145354 A214345 * A157755 A265812 A128352
KEYWORD
nonn
AUTHOR
Leroy Quet, Oct 06 2009
EXTENSIONS
Extended by Ray Chandler, Mar 12 2010
STATUS
approved