

A093868


Smallest prime that differs from a multiple of n by unity.


5



2, 3, 2, 3, 11, 5, 13, 7, 17, 11, 23, 11, 53, 13, 29, 17, 67, 17, 37, 19, 41, 23, 47, 23, 101, 53, 53, 29, 59, 29, 61, 31, 67, 67, 71, 37, 73, 37, 79, 41, 83, 41, 173, 43, 89, 47, 281, 47, 97, 101, 101, 53, 107, 53, 109, 113, 113, 59, 353, 59, 367, 61, 127, 127, 131, 67, 269
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

Numbers n such that a(n1)=a(n+1)=n are A025584 (primes p such that p2 is not a prime).  Rick L. Shepherd, Aug 23 2004


LINKS



FORMULA



MAPLE

f:= proc(n) local j, k;
for k from 1 do
for j in [1, 1] do
if isprime(k*n+j) then return k*n+j fi
od od
end proc:


MATHEMATICA

a[n_] := Module[{p}, For[p = 2, True, p = NextPrime[p], If[Divisible[p1, n]  Divisible[p+1, n], Return[p]]]];


PROG

(PARI) a(n) = forprime(p=2, , if (!((p+1) % n)  !((p1) % n), return (p))); \\ Michel Marcus, Aug 08 2014


CROSSREFS

Cf. A034694 (Smallest prime == 1 (mod n)), A038700 (Smallest prime == 1 (mod n)).


KEYWORD



AUTHOR



EXTENSIONS



STATUS

approved



