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).

Original entry on oeis.org

2, 3, 2, 3, 19, 5, 13, 7, 17, 19, 43, 11, 103, 13, 29, 31, 67, 17, 37, 19, 41, 43, 137, 23, 149, 103, 53, 83, 173, 29, 61, 31, 131, 67, 139, 71, 73, 37, 233, 79, 163, 41, 257, 43, 89, 137, 281, 47, 97, 149, 101, 103, 211, 53, 109, 167, 113, 173, 353, 59, 487, 61, 251
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A034694.

Programs

  • Mathematica
    f[n_] := Block[{k = n - 1}, While[ !PrimeQ@k, k += n]; k]; Array[f, 63] (* Robert G. Wilson v, Jun 09 2009 *)
    With[{prs=Prime[Range[100]]},Table[SelectFirst[prs,Mod[#,n]==n-1&],{n,70}]] (* Harvey P. Dale, Apr 26 2023 *)
  • PARI
    N=10^8;  default(primelimit,N);
    a(n)=forprime(p=2,10^7, if(p%n==n-1,return(p)));
    /* Joerg Arndt, Apr 16 2013 */
    
  • PARI
    a(n)=my(j);while(!isprime(j++*n-1),);j*n-1 \\ Charles R Greathouse IV, Apr 18 2013