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.

Showing 1-1 of 1 results.

A072063 Smallest prime of form prime(n)+k*n, k>0.

Original entry on oeis.org

3, 5, 11, 11, 31, 19, 31, 43, 41, 59, 53, 61, 67, 71, 107, 101, 127, 79, 181, 131, 157, 101, 313, 113, 197, 127, 157, 163, 167, 173, 251, 163, 269, 173, 359, 223, 379, 239, 401, 293, 1163, 223, 277, 281, 467, 337, 587, 271, 521, 379, 641, 499
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 12 2002

Keywords

Comments

According to Dirichlet's theorem primes of form prime(n)+k*n exist for all n, as gcd(n, prime(n))=1.
Nontrivial least prime == prime(n) (mod n).

Examples

			n=3, prime(3)=5: 5+1*3=8 is not prime, but 5+2*3=11, therefore a(3)=11 and A072064(3)=2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,k,k0;
      p:= ithprime(n);
      if n::odd then k0:= 2 else k0:= 1 fi;
      for k from k0 by k0 do
        if isprime(p+k*n) then return p+k*n fi
      od:
    end proc:
    f(1):= 3:
    map(f, [$1..100]); # Robert Israel, Nov 27 2023
  • Mathematica
    sp[n_]:=Module[{p=Prime[n],k=1},While[!PrimeQ[p+k*n],k++];p+k*n]; Array[ sp,60] (* Harvey P. Dale, Apr 19 2019 *)
  • PARI
    a072063(n) = {my (p=prime(n), j); for (k=1, oo, if(isprime(j=p+k*n), return(j)))}; \\ Hugo Pfoertner, Nov 27 2023
Showing 1-1 of 1 results.