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 A051700 #15 Jul 02 2025 16:01:58 %S A051700 2,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,4,1,2,3,2,1,2,1,2,1,2, %T A051700 3,2,1,4,1,2,1,2,1,2,1,2,1,4,1,2,3,2,1,6,1,2,3,2,1,2,1,2,1,2,3,2,1,4, %U A051700 1,2,1,2,1,2,1,2,3,2,1,4,1,2,1,4,1,2,3,2,1,6,1,2,3,4,3,2,1,4,1,2,1,2,1,2,1 %N A051700 Distance from n to closest prime that is different from n. %H A051700 T. D. Noe, <a href="/A051700/b051700.txt">Table of n, a(n) for n = 0..10000</a> %e A051700 Closest primes to 0,1,2,3,4 are 2,2,3,2,3. %p A051700 with(numtheory); f := n->min(nextprime(n)-n, n-prevprime(n)); %t A051700 Table[Min[NextPrime[n]-n,n-NextPrime[n,-1]],{n,0,200}] (* _Harvey P. Dale_, Mar 27 2011 *) %Y A051700 Related sequences: A023186-A023188, A046929-A046931, A051650, A051652, A051697-A051702, A051728-A051730. %K A051700 nonn,easy,nice %O A051700 0,1 %A A051700 _N. J. A. Sloane_ %E A051700 More terms from _James Sellers_