login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A093868 Smallest prime that differs from a multiple of n by unity. 4
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(n-1)=a(n+1)=n are A025584 (primes p such that p-2 is not a prime). - Rick L. Shepherd, Aug 23 2004

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

FORMULA

a(n) = min(A034694(n), A038700(n)) for all n >= 1. - Rick L. Shepherd, Aug 23 2004

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:

map(f, [$1..100]); # Robert Israel, Nov 07 2019

PROG

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

CROSSREFS

Cf. A093869.

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

Sequence in context: A264766 A251090 A078331 * A194603 A183465 A223168

Adjacent sequences:  A093865 A093866 A093867 * A093869 A093870 A093871

KEYWORD

nonn,look,changed

AUTHOR

Amarnath Murthy, Apr 20 2004

EXTENSIONS

More terms from Rick L. Shepherd, Aug 23 2004

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 18 14:59 EST 2019. Contains 329262 sequences. (Running on oeis4.)