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
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(n)=2 indicates at least one twin prime.
From Charles R Greathouse IV, Feb 15 2011: (Start)
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.
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)
LINKS
EXAMPLE
Primes between 81 = 9^2 and 100 = (9+1)^2: 83, 89 and 97; so 89 - 83 = 6 = a(9).
PROG
(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
(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
CROSSREFS
Sequence in context: A008838 A248783 A244462 * A334510 A211455 A214079
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Aug 17 2001
STATUS
approved

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 July 13 14:24 EDT 2024. Contains 374284 sequences. (Running on oeis4.)