# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a060268 Showing 1-1 of 1 %I A060268 #11 Sep 16 2020 05:01:27 %S A060268 1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,3,1,1,1,1,1,1,1,3,1,1,3,1,1,1,3,1,1,1, %T A060268 1,1,3,1,1,1,1,3,1,1,3,3,1,1,1,1,1,1,1,1,1,1,3,5,7,5,3,1,1,1,1,3,1,1, %U A060268 1,3,5,3,1,1,1,3,1,1,3,1,1,1,1,3,1,1,3,1,1,1,3,5,3,1,1,1,1,1,1,3,5,5,3,1,1 %N A060268 Distance of 2n from the closest prime. %F A060268 a(n) = min(A049653(n), A060266(n)). - _Michel Marcus_, Sep 16 2020 %e A060268 n=13, 2n=26 surrounded by 23 and 29 which are from 26 in equal distance of 3 and min{3,3}=3=a(13). %p A060268 with(numtheory): [seq(min(nextprime(2*i)-2*i, 2*i-prevprime(2*i)), i=2...256)]; %t A060268 a[n_] := Min[NextPrime[2*n] - 2*n, 2*n - NextPrime[2*n, -1]]; Array[a, 100, 2] (* _Amiram Eldar_, Sep 16 2020 *) %o A060268 (PARI) a(n) = min(2*n - precprime(2*n-1), nextprime(2*n+1) - 2*n); \\ _Michel Marcus_, Sep 16 2020 %Y A060268 Cf. A020482, A049653, A051702, A059959, A060266. %K A060268 nonn %O A060268 2,12 %A A060268 _Labos Elemer_, Mar 23 2001 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE