|
|
A188666
|
|
Largest m <= n such that lcm(m, m+1, ..., n) = lcm(1, 2, ..., n).
|
|
6
|
|
|
1, 2, 2, 3, 3, 4, 4, 5, 5, 7, 7, 7, 7, 8, 8, 9, 9, 11, 11, 11, 11, 13, 13, 13, 13, 16, 16, 16, 16, 16, 16, 17, 17, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 23, 23, 25, 25, 25, 25, 27, 27, 27, 27, 29, 29, 29, 29, 31, 31, 31, 31, 32, 32, 37, 37, 37, 37, 37, 37
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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));
|
|
LINKS
|
|
|
FORMULA
|
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|