A058022 Difference between lcm(1,..,n) and the largest prime before lcm(1,..,n) where n runs over the prime powers A000961, LCMs are in A051451.
3, 4, 1, 1, 1, 1, 1, 17, 19, 23, 17, 43, 1, 1, 29, 41, 1, 43, 1, 43, 47, 83, 1, 83, 61, 149, 1, 97, 89, 109, 113, 103, 113, 89, 137, 1, 157, 181, 239, 139, 241, 139, 179, 233, 193, 163, 241, 173, 283, 167, 271, 193, 277, 181, 179, 199, 1, 193, 223, 239, 239, 233, 751
Offset: 1
Keywords
Examples
6th and 7th different values of LCM-s are 840 and 2520. Deviation of immediate preceding primes(839,2503) are:1 and 17. For n=1 LCM[1]=1 and prime=-2 is the largest with deviation 3. So the sequence starts with 3.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..1000
Programs
-
Maple
f:= proc(n) local m; m:= ilcm($1..n); if m < 3 then m + 2 else m - prevprime(m) fi end proc: A000961:= select(t -> nops(numtheory:-factorset(t))<=1, [$1..1000]): map(f, A000961); # Robert Israel, Nov 18 2015
-
PARI
N=2; print1("3, 4"); for(n=3,1e3, if(isprimepower(n,&p), N*=p; print1(", "N-precprime(N-1)))) \\ Charles R Greathouse IV, Nov 18 2015
Comments