OFFSET
1,2
COMMENTS
See A073666 for a nonincreasing version and A096100 for a more restrictive constraint. - M. F. Hasler, Nov 24 2015
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
MATHEMATICA
f[s_List] := Block[{k = m = s[[-1]]}, k++; While[ !PrimeQ[k*m + 1], k++]; Append[s, k]]; Nest[f, {1}, 57] (* Robert G. Wilson v, Dec 02 2012 *)
smp[n_]:=Module[{m=n+1}, While[!PrimeQ[m*n+1], m++]; m]; NestList[smp, 1, 60] (* Harvey P. Dale, Dec 12 2018 *)
PROG
(PARI) A081942(n, show=0, a=1)={for(n=2, n, show&&print1(a", "); for(k=a+1, 9e9, isprime(a*k+1) && (a=k) && break)); a} \\ Use 2nd or 3rd optional arg to print intermediate terms or to use another starting value. - M. F. Hasler, Nov 24 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Apr 02 2003
EXTENSIONS
More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 08 2003
STATUS
approved