This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A087770 #18 Dec 17 2019 05:53:05 %S A087770 2,3,7,23,89,211,1847,2179,14107,33247,38501,58831,268343,1272749, %T A087770 2198981,10938023,72546283,162821917,325737821,2888688863,6613941601, %U A087770 11179888193,24016237123,96155166493,179474021633,215686840471,633880576177,1480975873513,9156364643509 %N A087770 "Lonely primes": those primes that are locally maximally isolated from the nearest other primes. The differences between each lonely prime and the immediately preceding prime and following primes are both greater than the corresponding differences for all lonely primes earlier in the sequence. %C A087770 The concept of "lonely prime" is similar to that of maximal prime gaps since lonely primes are increasingly distant from each other. %C A087770 See A023186 for another version of this sequence, which only requires increasing the minimum of the two gaps to the neighbors. The definition from A023186 seems to be the more common variant. - _Hugo Pfoertner_, Dec 17 2019 %e A087770 a(0) = 2. %e A087770 a(1) = 3 because 3 - 2 = 1 and 5 - 3 = 2. %e A087770 a(2) = 7 because 7 - 5 = 2 (and 2 > 3 - 2) and 11 - 7 = 4 (and 4 > 5 - 3). %e A087770 a(3) = 23 because 23 - 19 = 4 ( 23 - 19 > 7 - 5) and 29 - 23 = 6 (29 - 23 > 11 - 7). %e A087770 a(4) = 89 because 89 - 83 = 6 > 23 - 19 and 97 - 89 = 8 > 29 - 23. %e A087770 Note, for example, that 53 is not a lonely prime because 53 - 47 = 6, which is > 23 - 19 however 59 - 53 = 6, which is not > 29 - 23. %t A087770 NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 2; q = 2; r = 3; d = e = 0; Do[ While[ q - p <= d || r - q <= e, p = q; q = r; r = NextPrim[r]]; Print[q]; d = Max[q - p, d]; e = Max[r - q, e]; p = q; q = r; r = NextPrim[r], {n, 1, 40}] (* _Robert G. Wilson v_ *) %Y A087770 Cf. A000230, A002386, A023186. %K A087770 nonn %O A087770 1,1 %A A087770 _Walter Carlini_, Oct 03 2003 %E A087770 Corrected and extended by _Ray Chandler_, Oct 06 2003 %E A087770 Offset changed and a(21)-a(27) from _Hugo Pfoertner_, Dec 17 2019 %E A087770 a(28)-a(29) from _Giovanni Resta_, Dec 17 2019