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!)
A111213 Difference between the closest squares surrounding prime p is prime. 1

%I #23 Jun 11 2016 12:40:26

%S 3,3,5,5,7,7,11,11,13,13,13,13,17,17,17,17,19,19,19,23,23,23,23,29,29,

%T 29,29,31,31,31,31,31,31,37,37,37,37,37,37,41,41,41,41,41,41,41,43,43,

%U 43,43,43,43,43,47,47,47,47,47,47

%N Difference between the closest squares surrounding prime p is prime.

%C Conjecture: The number of terms in this sequence is infinite.

%C The number of occurrences of odd prime x is A014085((x-1)/2). - _Robert Israel_, Jun 08 2016

%H Robert Israel, <a href="/A111213/b111213.txt">Table of n, a(n) for n = 2..10001</a>

%F Let p be a prime number and r = floor(sqrt(p)). Then the closest surrounding squares of p are r^2 and (r+1)^2. So d = (r+1)^2 - r^2 = 2r+1. If d is prime then list d.

%e 29 is a prime number. 5^2 and 6^2 are the closest squares surrounding 29. Now the difference, 36-25 = 11 is prime so 11 is in the table.

%p g:= proc(q) local x; x:= (q-1)/2; numtheory:-pi((x+1)^2) - numtheory:-pi(x^2) end proc:

%p seq(p$g(p), p = select(isprime,[seq(i,i=3..1000,2)])); # _Robert Israel_, Jun 08 2016

%t Select[Table[Ceiling[#]^2 - Floor[#]^2 &@ Sqrt@ Prime@ n, {n, 120}], PrimeQ] (* _Michael De Vlieger_, Jun 10 2016 *)

%o (PARI) surrsqpr(n) = { local(x,y,j,r,d); forprime(x=2,n, r=floor(sqrt(x)); d=r+r+1; if(isprime(d), print1(d",") ) ) }

%Y Cf. A014085.

%K easy,nonn

%O 2,1

%A _Cino Hilliard_, Nov 12 2005

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 August 6 23:54 EDT 2024. Contains 375002 sequences. (Running on oeis4.)