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!)
A063790 a(n) is the smallest prime gap between n^2 and (n+1)^2. 1

%I #14 Jun 25 2018 03:22:12

%S 1,2,2,2,2,2,2,2,6,2,2,2,2,2,2,2,2,2,4,2,2,2,2,2,2,6,4,2,2,4,2,2,2,4,

%T 2,2,2,2,4,2,2,2,2,2,2,2,2,2,4,2,2,2,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,

%U 2,2,2,2,2,2,2,2,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2

%N a(n) is the smallest prime gap between n^2 and (n+1)^2.

%C a(n)=2 indicates at least one twin prime.

%C From _Charles R Greathouse IV_, Feb 15 2011: (Start)

%C a(1) = 1. a(n) = 4 for n in {9, 19, 26, 27, 30, 34, 39, 49, 53, 77, 122}. Is a(n) = 2 for all other n? That is, for n > 122, is there always a twin prime between n^2 and (n+1)^2? It holds for the first million terms.

%C This is a stronger version of the conjecture (on which the definition of this sequence relies!) that there is always a prime between n^2 and (n+1)^2. (End)

%H Harry J. Smith, <a href="/A063790/b063790.txt">Table of n, a(n) for n = 1..2000</a>

%e Primes between 81 = 9^2 and 100 = (9+1)^2: 83, 89 and 97; so 89 - 83 = 6 = a(9).

%o (PARI) { for (n=1, 2000, p=nextprime(n^2); q=precprime((n + 1)^2); a=q-p; r=0; while (r<q, r=nextprime(p+1); g=r-p; p=r; if (g<a, a=g)); write("b063790.txt", n, " ", a) ) } \\ _Harry J. Smith_, Aug 31 2009

%o (PARI) a(n)=my(p=nextprime(n^2),q=nextprime(p+1),r=q-p,N=(n+1)^2);while(r>2&q<N, p=q; q=nextprime(q+1); if(q-p<r,r=q-p)); r \\ _Charles R Greathouse IV_, Feb 15 2011

%K nonn

%O 1,2

%A _Reinhard Zumkeller_, Aug 17 2001

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 September 15 03:44 EDT 2024. Contains 375931 sequences. (Running on oeis4.)