login
A081942
a(1) = 1, a(n) = smallest number greater than a(n-1) such that a(n-1)*a(n) + 1 is prime.
6
1, 2, 3, 4, 7, 10, 13, 24, 25, 28, 34, 37, 40, 43, 46, 51, 56, 60, 67, 70, 79, 84, 87, 94, 105, 106, 120, 126, 130, 133, 136, 147, 148, 151, 156, 161, 162, 163, 166, 171, 176, 177, 184, 190, 193, 204, 208, 211, 228, 234, 239, 242, 248, 252, 256, 262, 265, 270
OFFSET
1,2
COMMENTS
See A073666 for a nonincreasing version and A096100 for a more restrictive constraint. - M. F. Hasler, Nov 24 2015
LINKS
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