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 A060272 #19 Jun 26 2021 15:30:31 %S A060272 1,1,2,1,2,1,2,3,2,1,6,5,2,1,2,1,4,7,2,1,2,3,6,1,6,1,2,3,2,7,6,3,2,3, %T A060272 2,1,2,3,2,1,12,5,2,3,2,3,2,5,2,3,8,3,6,1,2,1,2,3,10,7,2,3,2,3,4,1,4, %U A060272 3,2,3,2,5,4,1,2,3,2,5,6,3,2,5,6,1,4,3,4,3,2,1,6,3,2,1,4,5,4,3,2,7,8,5,2 %N A060272 Distance from n^2 to closest prime. %H A060272 Michael De Vlieger, <a href="/A060272/b060272.txt">Table of n, a(n) for n = 1..10000</a> %F A060272 a(n) = abs(A000290(n) - A113425(n)) = abs(A000290(n) - A113426(n)). - _Reinhard Zumkeller_, Oct 31 2005 %e A060272 n=1: n^2=1 has next prime 2, so a(1)=1; %e A060272 n=11: n^2=121 is between primes {113,127} and closer to 127, thus a(11)=6. %p A060272 seq((s-> min(nextprime(s)-s, `if`(s>2, s-prevprime(s), [][])))(n^2), n=1..256); # edited by _Alois P. Heinz_, Jul 16 2017 %t A060272 Table[Function[k, Min[k - #, NextPrime@ # - k] &@ If[n == 1, 0, Prime@ PrimePi@ k]][n^2], {n, 103}] (* _Michael De Vlieger_, Jul 15 2017 *) %t A060272 Min[#-NextPrime[#,-1],NextPrime[#]-#]&/@(Range[110]^2) (* _Harvey P. Dale_, Jun 26 2021 *) %o A060272 (PARI) a(n) = if (n==1, nextprime(n^2) - n^2, min(n^2 - precprime(n^2), nextprime(n^2) - n^2)); \\ _Michel Marcus_, Jul 16 2017 %Y A060272 Cf. A007491, A053001, A058043, A056927, A053000, A051700, A060268-A060269, A060272, A059959, A059790. %K A060272 nonn %O A060272 1,3 %A A060272 _Labos Elemer_, Mar 23 2001