login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = Min { { smallest prime > k } - k, k - { largest prime < k } }, where k = lcm(1..n) = A003418(n).
0

%I #14 Jan 01 2019 17:07:50

%S 1,1,1,1,1,1,1,1,13,13,23,23,23,17,19,19,1,1,1,1,1,1,1,1,31,31,1,1,1,

%T 1,1,1,1,1,43,43,43,43,47,47,59,59,59,59,1,1,59,59,59,59,61,61,61,61,

%U 61,61,113,113,1,1,1,97,97,97,73,73,73,73,73,73,97

%N a(n) = Min { { smallest prime > k } - k, k - { largest prime < k } }, where k = lcm(1..n) = A003418(n).

%p [seq( min( nextprime(A003418(n))-A003418(n), A003418(n)-prevprime(A003418(n)) ), n=3..100)];

%t Min[NextPrime[#]-#,#-NextPrime[#,-1]]&/@Table[LCM@@Range[n],{n,80}] (* _Harvey P. Dale_, Jan 01 2019 *)

%o (PARI) a(n) = my(lcn = lcm([1..n])); min(nextprime(lcn+1)-lcn, lcn-precprime(lcn-1)); \\ _Michel Marcus_, Mar 29 2018

%Y Cf. A003418, A060357, A060358, A060359, A060360, A060361.

%K nonn

%O 3,9

%A _N. J. A. Sloane_, Apr 01 2001

%E Definition corrected by _Jon E. Schoenfield_, Mar 18 2018