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 A075051 #14 Feb 05 2025 19:36:39 %S A075051 3,113,113,113,1327,1327,15683,15683,248909,265621,492113,492113, %T A075051 3851459,7743233,18640103,18640103,18640103,435917249,435917249, %U A075051 435917249,649580171,649580171,19187736221,19187736221,19187736221,94746870541,94746870541,673420121333,1975675658371 %N A075051 Smallest prime for which the n closest primes are smaller. %C A075051 It is surprising that few of the above entries are at the beginning of a prime gap in A000230 or A002386. %e A075051 The smallest prime number for which the three closest primes to itself are all smaller than itself is 113 (the closest primes being 109, 107 and 103). So a(3)=113. %t A075051 NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; k = 1; Do[ps = Table[0, {n + 1}]; ps = Append[ps, Max[k, 1]]; While[ps = Drop[ps, 1]; ps = Append[ps, NextPrim[ ps[[ -1]]]]; ps[[ -1]] - ps[[ -2]] <= ps[[ -2]] - ps[[1]], ]; Print[ ps[[ -2]]]; k = PrevPrim[ ps[[1]]], {n, 1, 30}] %Y A075051 Cf. A001223, A074979, A074982, A075030, A075037, A075038, A075043, A075050. %K A075051 nonn %O A075051 1,1 %A A075051 _Neil Fernandez_, Oct 10 2002 %E A075051 Edited and extended by _Robert G. Wilson v_, Oct 12 2002 %E A075051 a(23)-a(29) from _Donovan Johnson_, Jun 19 2008