login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
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

%I #39 Nov 21 2014 21:27:15

%S 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,

%T 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,

%U 2,2,11,2,23,17,2,2,2,2,2,3

%N 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.

%C The first prime prime(n) with no solution is prime(1300)=10657.

%C There are 43 terms 0 within the first 10000 primes.

%H Pierre CAMI, <a href="/A248743/b248743.txt">Table of n, a(n) for n = 1..10000</a>

%e 2=3*(2-1)-1, so a(1)=3.

%e 3=2*(3-1)-1, so a(2)=2.

%e 5=2*(2+1)-1=2*(3-1)+1, so a(3)=2.

%e 7=2*(2+1)+1=2*(3+1)-1=2*(5-1)-1, so a(4)=2.

%o (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

%K nonn

%O 1,1

%A _Pierre CAMI_, Oct 13 2014

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)