OFFSET
1,3
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
FORMULA
Let f(n) = lcm(1, 2, ..., n-1) = A003418(n-1). If n = 2*p^k for some prime p, then a(n) = f(n)/p; otherwise a(n) = f(n).
EXAMPLE
For n=10: non-divisors = {3,4,6,7,8,9}, lcm(3,4,6,7,8,9) = 8*9*7 = 504 = a(10).
For n=18, a(18) = lcm(4,5,7,8,10,11,12,13,14,15,16,17) = 4084080.
MATHEMATICA
a[n_] := LCM@@Select[Range[1, n-1], Mod[n, # ]!=0& ]
Join[{1, 1}, Table[LCM@@Complement[Range[n], Divisors[n]], {n, 3, 30}]] (* Harvey P. Dale, Mar 27 2013 *)
PROG
(Haskell)
a067391 n | n <= 2 = 1
| otherwise = foldl lcm 1 $ a173540_row n
-- Reinhard Zumkeller, Apr 04 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jan 22 2002
STATUS
approved