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!)
A038700 Smallest prime == -1 (mod n). 17

%I #19 Apr 26 2023 16:45:09

%S 2,3,2,3,19,5,13,7,17,19,43,11,103,13,29,31,67,17,37,19,41,43,137,23,

%T 149,103,53,83,173,29,61,31,131,67,139,71,73,37,233,79,163,41,257,43,

%U 89,137,281,47,97,149,101,103,211,53,109,167,113,173,353,59,487,61,251

%N Smallest prime == -1 (mod n).

%H Joerg Arndt, <a href="/A038700/b038700.txt">Table of n, a(n) for n = 1..1000</a>

%t f[n_] := Block[{k = n - 1}, While[ !PrimeQ@k, k += n]; k]; Array[f, 63] (* _Robert G. Wilson v_, Jun 09 2009 *)

%t With[{prs=Prime[Range[100]]},Table[SelectFirst[prs,Mod[#,n]==n-1&],{n,70}]] (* _Harvey P. Dale_, Apr 26 2023 *)

%o (PARI)

%o N=10^8; default(primelimit,N);

%o a(n)=forprime(p=2,10^7, if(p%n==n-1,return(p)));

%o /* _Joerg Arndt_, Apr 16 2013 */

%o (PARI) a(n)=my(j);while(!isprime(j++*n-1),);j*n-1 \\ _Charles R Greathouse IV_, Apr 18 2013

%Y Cf. A034694.

%K nonn,easy

%O 1,1

%A _David W. Wilson_

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 23 08:29 EDT 2024. Contains 371905 sequences. (Running on oeis4.)