OFFSET
0,3
EXAMPLE
a(3) = 6 because A006862(6) - 6! = 30031-720 = 29311 and is the 3rd such prime.
MATHEMATICA
primeproduct[q_] := Product[Prime[r], {r, 1, q}]; nextterm[n_] := (p=n+1; While[!PrimeQ[primeproduct[p]+1-p!], p++]; p); Table[Nest[nextterm, 0, m], {m, 1, 5}] (* changing 5 to 10 will give all 10 terms but takes a long time *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Frank M Jackson, Mar 12 2013
STATUS
approved