login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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
Sequence in context: A261616 A333615 A329774 * A228588 A189720 A072958
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Apr 02 2003
EXTENSIONS
More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 08 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 05:02 EDT 2024. Contains 371782 sequences. (Running on oeis4.)