OFFSET
0,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
EXAMPLE
3+5-1=7 is a prime. 5 is in the sequence.
5+7-1=11 is a prime: 11 is in the sequence.
11+13-1=23 is a prime: 13 is in the sequence.
13+17-1=29 is a prime: 17 is in the sequence.
17+19-1=35 is not a prime.
MAPLE
P:=proc(n) local i, w; w:=3; for i from 3 by 1 to n do if isprime(w+ithprime(i)-1) then print(ithprime(i)); w:=ithprime(i); fi; od; end: P(500);
MATHEMATICA
nxt[n_]:=NestWhile[NextPrime[#]&, NextPrime[n], !PrimeQ[n+#-1]&]; NestList[ nxt, 3, 60] (* Harvey P. Dale, Oct 02 2011 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Mar 07 2007, Mar 08 2007
STATUS
approved