

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

Harry J. Smith, Table of n, a(n) for n = 1..2000


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=qp; r=0; while (r<q, r=nextprime(p+1); g=rp; 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=qp, N=(n+1)^2); while(r>2&q<N, p=q; q=nextprime(q+1); if(qp<r, r=qp)); r \\ Charles R Greathouse IV, Feb 15 2011


CROSSREFS

Sequence in context: A008838 A248783 A244462 * A334510 A211455 A214079
Adjacent sequences: A063787 A063788 A063789 * A063791 A063792 A063793


KEYWORD

nonn


AUTHOR

Reinhard Zumkeller, Aug 17 2001


STATUS

approved



