%I #22 Oct 28 2021 12:37:08
%S 2,7,1831,9551,89689,396733,11981443,70396393,1872851947,10958687879,
%T 47203303159,767644374817,8817792098461,78610833115261,
%U 497687231721157,2069461000669981,22790428875364879,78944802602538877
%N First occurrence of prime gaps which are squares.
%C 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
%H Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/gaps/gaplist.html">First occurrence prime gaps</a> [For local copy see A000101]
%e Notes by Thomas R. Nicely:
%e 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.
%e prime,gap
%e 2, 1=1^2
%e 7, 4=2^2
%e 1831, 16=4^2
%e 9551, 36=6^2
%e 89689, 64=8^2
%e 396733, 100=10^2
%e 11981443, 144=12^2
%e 70396393, 196=14^2
%e 1872851947, 256=16^2
%e 10958687879, 324=18^2
%e 47203303159, 400=20^2
%e 767644374817, 484=22^2
%e 8817792098461, 576=24^2
%e 78610833115261, 676=26^2
%e 497687231721157, 784=28^2
%e 2069461000669981, 900=30^2
%e 22790428875364879, 1024=32^2
%e 78944802602538877, 1156=34^2
%e 2980374211158121907, 1296=36^2
%e 18479982848279580912452968237, 1444=38^2
%e 10338270318362067887873513954823823, 1600=40^2
%e 5462539353768233509094313080601639583, 1764=42^2
%e 9634432076725832064810529394509018411, 1936=44^2
%e 24103660699017475735076387748469761375352177, 2116=46^2
%e 1171872038536282864481405693168029955108099, (*48^2*)
%e 169512938487733553802932479078305855585466971701227, (*50^2*)
%e 228422210024736896126707605155690522381875250546666532046327, (*52^2*)
%e 7229972437439469171089374324333535009566526827968927563, (*54^2*)
%e 1263895714932859021916447978075625934206362807439043695674222113, (*56^2*)
%e 569493611436727594340298806603382857255173440636060754222617328828425379, (*58^2*)
%e 281376087412013738611508677824321032930454474305215907812114263492815921, (*60^2*)
%e 680561565394793619717614472954048053005171290126070180152868857556290989645629867 (*62^2*)
%t Function[w, Prime@ First@ # & /@ Map[w[[ Key@ # ]] &, Select[Keys@ w, IntegerQ@ Sqrt@ # &]]]@ PositionIndex@ Differences@ Prime@ Range[10^7] (* _Michael De Vlieger_, Oct 27 2016 *)
%o (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
%K nonn
%O 0,1
%A _Zak Seidov_, Mar 05 2008
%E Edited by _N. J. A. Sloane_, Oct 28 2016
%E Misprints in EXAMPLE fixed by _Zak Seidov_, Oct 18 2018