A094307 The k-th term of the n-th row of the following triangle is the least common multiple of all numbers from 1 to n except k. Sequence contains the triangle by rows.
1, 2, 1, 6, 3, 2, 12, 12, 4, 6, 60, 60, 20, 30, 12, 60, 60, 60, 30, 12, 60, 420, 420, 420, 210, 84, 420, 60, 840, 840, 840, 840, 168, 840, 120, 420, 2520, 2520, 2520, 2520, 504, 2520, 360, 1260, 840, 2520, 2520, 2520, 2520, 2520, 2520, 360, 1260, 840, 2520, 27720
Offset: 1
Examples
Triangle begins: 1, 2, 1, 6, 3, 2, 12, 12, 4, 6, 60, 60, 20, 30, 12, 60, 60, 60, 30, 12, 60;
Crossrefs
Cf. A094308.
Programs
-
Maple
A094307 := proc(n,k) local a,i ; if n = 1 then RETURN(1) ; elif k > 1 and k < n then a := [seq(i,i=1..k-1),seq(i,i=k+1..n)] ; elif k = n then a := [seq(i,i=1..k-1)] ; else a := [seq(i,i=2..n)] ; fi ; ilcm(op(a)) ; end: for n from 1 to 15 do for k from 1 to n do printf("%d, ",A094307(n,k)) ; od ; od ; # R. J. Mathar, Apr 30 2007
-
Mathematica
T[n_, k_] := LCM @@ Which[n == 1, {1}, 1 < k < n, Join[Range[k-1], Range[k+1, n]], k == n, Range[k-1], True, Range[2, n]]; Table[T[n, k], {n, 1, 15}, {k, 1, n}] // Flatten (* Jean-François Alcover, May 20 2020 *)
-
PARI
T(n,k) = lcm(setminus(vector(n, i, i), Set(k))); tabl(nn) = {for (n=1, nn, for (k=1, n, print1(T(n, k), ", ");); print(););} \\ Michel Marcus, Jun 15 2019
Formula
T(n,k) = A003418(n)/p if k = p^m for some m and n < 2*p^m and A003418(n) otherwise. - Charlie Neder, Jun 13 2019
Extensions
More terms from R. J. Mathar, Apr 30 2007
Comments