A058018 Difference between LCM(1,...,x) and the smallest prime > LCM(1,...,x), where x is the n-th prime power (A000961).
1, 1, 1, 1, 1, 1, 13, 1, 13, 31, 23, 19, 1, 41, 1, 31, 43, 1, 41, 53, 79, 59, 1, 59, 61, 113, 97, 179, 73, 73, 97, 103, 101, 109, 1, 229, 109, 139, 113, 227, 131, 191, 163, 1, 199, 151, 139, 1, 223, 229, 367, 239, 499, 251, 509, 251, 227, 373, 281, 233, 283, 229, 277, 263
Offset: 1
Keywords
Examples
The 6th distinct prime power is A000961(7) = 8, LCM(1,...,8) = 840 and 853 is the first prime that follows, thus a(7) = 853-840 = 13.
Programs
-
Mathematica
With[{max = 250}, (NextPrime[#] - #)& /@ Exp[Accumulate[Join[{0}, Select[Array[MangoldtLambda, max], # > 0 &]]]]] (* Amiram Eldar, Aug 13 2024 *)
-
PARI
lista(nn) = {for (n=1, nn, if ((n==1) || isprimepower(n), v = lcm(vector(n, x, x)); print1(nextprime(v+1) - v, ", ")););} \\ Michel Marcus, Apr 09 2015
Formula
Extensions
Edited by Franklin T. Adams-Watters, Aug 15 2006
Offset set to 1 by Michel Marcus, Apr 09 2015
Name corrected by Amiram Eldar, Aug 13 2024
Comments