cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A038700 Smallest prime == -1 (mod n).

This page as a plain text file.
%I A038700 #24 Aug 10 2025 19:24:55
%S A038700 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 A038700 149,103,53,83,173,29,61,31,131,67,139,71,73,37,233,79,163,41,257,43,
%U A038700 89,137,281,47,97,149,101,103,211,53,109,167,113,173,353,59,487,61,251
%N A038700 Smallest prime == -1 (mod n).
%H A038700 Vladimir Pletser, <a href="/A038700/b038700.txt">Table of n, a(n) for n = 1..20000</a> (first 1000 terms from Joerg Arndt)
%t A038700 f[n_] := Block[{k = n - 1}, While[ !PrimeQ@k, k += n]; k]; Array[f, 63] (* _Robert G. Wilson v_, Jun 09 2009 *)
%t A038700 With[{prs=Prime[Range[100]]},Table[SelectFirst[prs,Mod[#,n]==n-1&],{n,70}]] (* _Harvey P. Dale_, Apr 26 2023 *)
%o A038700 (PARI)
%o A038700 N=10^8;  default(primelimit,N);
%o A038700 a(n)=forprime(p=2,10^7, if(p%n==n-1,return(p)));
%o A038700 /* _Joerg Arndt_, Apr 16 2013 */
%o A038700 (PARI) a(n)=my(j);while(!isprime(j++*n-1),);j*n-1 \\ _Charles R Greathouse IV_, Apr 18 2013
%Y A038700 Cf. A034694.
%K A038700 nonn,easy
%O A038700 1,1
%A A038700 _David W. Wilson_