OFFSET
0,1
COMMENTS
More precisely, consider the possible squares which can occur as prime gaps: g_0=1, g_1=2^2, g_2=4^2, g_3=6^2, g_4=8^2, ... Then a(n) = smallest prime p(i) such that p(i+1)-p(i) = g_n, or a(n) = -1 if the gap g_n never occurs. - N. J. A. Sloane, Oct 28 2016
LINKS
Thomas R. Nicely, First occurrence prime gaps [For local copy see A000101]
EXAMPLE
Notes by Thomas R. Nicely:
No gap exceeding 1442 has been definitively established as a first occurrence; larger gaps included in these lists are instead first occurrences presently known of prime gaps. The smallest gap whose first occurrence remains uncertain is the (nonsquare) gap of 1208.
prime,gap
2, 1=1^2
7, 4=2^2
1831, 16=4^2
9551, 36=6^2
89689, 64=8^2
396733, 100=10^2
11981443, 144=12^2
70396393, 196=14^2
1872851947, 256=16^2
10958687879, 324=18^2
47203303159, 400=20^2
767644374817, 484=22^2
8817792098461, 576=24^2
78610833115261, 676=26^2
497687231721157, 784=28^2
2069461000669981, 900=30^2
22790428875364879, 1024=32^2
78944802602538877, 1156=34^2
2980374211158121907, 1296=36^2
18479982848279580912452968237, 1444=38^2
10338270318362067887873513954823823, 1600=40^2
5462539353768233509094313080601639583, 1764=42^2
9634432076725832064810529394509018411, 1936=44^2
24103660699017475735076387748469761375352177, 2116=46^2
1171872038536282864481405693168029955108099, (*48^2*)
169512938487733553802932479078305855585466971701227, (*50^2*)
228422210024736896126707605155690522381875250546666532046327, (*52^2*)
7229972437439469171089374324333535009566526827968927563, (*54^2*)
1263895714932859021916447978075625934206362807439043695674222113, (*56^2*)
569493611436727594340298806603382857255173440636060754222617328828425379, (*58^2*)
281376087412013738611508677824321032930454474305215907812114263492815921, (*60^2*)
680561565394793619717614472954048053005171290126070180152868857556290989645629867 (*62^2*)
MATHEMATICA
Function[w, Prime@ First@ # & /@ Map[w[[ Key@ # ]] &, Select[Keys@ w, IntegerQ@ Sqrt@ # &]]]@ PositionIndex@ Differences@ Prime@ Range[10^7] (* Michael De Vlieger, Oct 27 2016 *)
PROG
(PARI) a(n)=my(k=max(1, 4*(n-1)^2), p=2); forprime(q=3, , if(q-p==k, return(p)); p=q) \\ Charles R Greathouse IV, Jun 05 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Mar 05 2008
EXTENSIONS
Edited by N. J. A. Sloane, Oct 28 2016
Misprints in EXAMPLE fixed by Zak Seidov, Oct 18 2018
STATUS
approved