cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A188666 Largest m <= n such that lcm(m, m+1, ..., n) = lcm(1, 2, ..., n).

Original entry on oeis.org

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
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 25 2011

Keywords

Comments

By definition: A003418(n) = lcm(a(n), a(n)+1, ... n)
and lcm(m, m+1, ... n) < A003418(n) for m > a(n);
all terms are prime powers, cf. A000961: A010055(a(n)) = 1;
a(A110654(n)) = A000015(n);
floor(n/2)+1 <= a(n) < a(2*(a(n));
A000961(n+1) = a(2*A000961(n)) = a(A138929(n)), cf. formula.
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

Crossrefs

Programs

  • 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]
    
  • 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 *)
  • 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

Formula

a(n) = A000961(k+1) for n: 2*A000961(k) <= n < 2*A000961(k+1), k > 0.