The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A248743 Smallest prime Q such that there is a prime R such that Q*(R+1)+1 or Q*(R+1)-1 or Q*(R-1)+1 or Q*(R-1)-1 is prime(n), or 0 if no such prime Q exists. 1
 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 3, 3, 2, 2, 2, 2, 5, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 2, 2, 2, 3, 2, 2, 2, 47, 3, 3, 2, 2, 2, 2, 2, 2, 2, 11, 2, 23, 17, 2, 2, 2, 2, 2, 3 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS The first prime prime(n) with no solution is prime(1300)=10657. There are 43 terms 0 within the first 10000 primes. LINKS Pierre CAMI, Table of n, a(n) for n = 1..10000 EXAMPLE 2=3*(2-1)-1, so a(1)=3. 3=2*(3-1)-1, so a(2)=2. 5=2*(2+1)-1=2*(3-1)+1, so a(3)=2. 7=2*(2+1)+1=2*(3+1)-1=2*(5-1)-1, so a(4)=2. PROG (PARI) a(p) = {if (p == 2, return (3)); forprime (q=2, p, if (!((p-1) % q) && (isprime((p-1)/q+1) || isprime((p-1)/q-1)), return (q)); if (!((p+1) % q) && (isprime((p+1)/q+1) || isprime((p+1)/q-1)), return (q)); ); } \\ to be used with a forprime loop; Michel Marcus, Oct 28 2014 CROSSREFS Sequence in context: A262626 A104435 A178815 * A085398 A252503 A270003 Adjacent sequences:  A248740 A248741 A248742 * A248744 A248745 A248746 KEYWORD nonn AUTHOR Pierre CAMI, Oct 13 2014 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.

Last modified May 31 19:11 EDT 2020. Contains 334748 sequences. (Running on oeis4.)