OFFSET
1,2
COMMENTS
By definition: A003418(n) = lcm(a(n), a(n)+1, ... n)
and lcm(m, m+1, ... n) < A003418(n) for m > a(n);
floor(n/2)+1 <= a(n) < a(2*(a(n));
A237709 gives number of occurrences of n-th prime power. - Reinhard Zumkeller, Feb 12 2014
Conjecture: a(n) = A000015(floor(n/2)+1). - Georg Fischer, Nov 29 2022
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Least Common Multiple
Wikipedia, Least Common Multiple
MATHEMATICA
Table[Block[{k = n, m = LCM @@ Range[n]}, While[LCM @@ Range[k, n] != m, k--]; k], {n, 69}] (* Michael De Vlieger, Nov 29 2022 *)
PROG
(Haskell)
import Data.List (elemIndices)
a188666 n = a188666_list !! (n-1)
a188666_list = g 1 a000961_list where
g n pps'@(pp:pp':pps) | n < 2*pp = pp : g (n+1) pps'
| otherwise = pp' : g (n+1) (pp':pps)
-- Alternative, rewriting the definition, but less efficient:
a188666' n = last $ elemIndices (f 1) $ map f [0..n] where
f from = foldl lcm 1 [from..n]
(PARI) A188666(n)=L=lcm(n=vector(n-1, k, k+1)); !for(m=1, #n, lcm(n[-m..-1])==L&&return(#n+2-m))\\ Rather illustrative than efficient. - M. F. Hasler, Jul 25 2015
(Python)
from itertools import count
from sympy import factorint
def A188666(n): return next(filter(lambda m:len(factorint(m))<=1, count((n>>1)+1))) # Chai Wah Wu, Oct 25 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Apr 25 2011
STATUS
approved