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.

Showing 1-2 of 2 results.

A181853 Triangle read by rows: T(n,k) = Sum_{c in C(n,k)} lcm(c) where C(n,k) is the set of all k-subsets of {1,2,...,n}.

Original entry on oeis.org

1, 1, 1, 1, 3, 2, 1, 6, 11, 6, 1, 10, 31, 34, 12, 1, 15, 81, 189, 182, 60, 1, 21, 141, 393, 494, 282, 60, 1, 28, 288, 1380, 3245, 3740, 2034, 420, 1, 36, 456, 2716, 8293, 13268, 11338, 4908, 840, 1, 45, 726, 5578, 22207, 47351, 57598, 40602, 15564, 2520
Offset: 0

Views

Author

Peter Luschny, Dec 06 2010

Keywords

Comments

The C(n,k) are also called combinations of n with size k (see A181842).
Main diagonal gives: A003418. Lower diagonal gives: A094308. Column k=1 gives: A000217. - Alois P. Heinz, Jul 29 2013

Examples

			[0]   1
[1]   1    1
[2]   1    3     2
[3]   1    6    11     6
[4]   1   10    31    34    12
[5]   1   15    81   189   182    60
[6]   1   21   141   393   494   282   60
		

Crossrefs

Row sums give A226037.

Programs

  • Maple
    with(combstruct):
    a181853_row := proc(n) local k,L,l,R,comb;
    R := NULL;
    for k from 0 to n do
       L := 0;
       comb := iterstructs(Combination(n),size=k):
       while not finished(comb) do
          l := nextstruct(comb);
          L := L + ilcm(op(l));
       od;
       R := R,L;
    od;
    R end:
    # second Maple program:
    b:= proc(n, k) option remember; `if`(k=0, [1],
         [`if`(k add(c, c=b(n, k)):
    seq(seq(T(n, k), k=0..n), n=0..10);  # Alois P. Heinz, Jul 29 2013
    # third Maple program:
    b:= proc(n, m) option remember; expand(`if`(n=0, m,
          b(n-1, ilcm(m, n))*x+b(n-1, m)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 1)):
    seq(T(n), n=0..10);  # Alois P. Heinz, Sep 05 2023
  • Mathematica
    t[, 0] = 1; t[n, k_] := Sum[LCM @@ c, {c, Subsets[Range[n], {k}]}]; Table[t[n, k], {n, 0, 8}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 29 2013 *)
  • Sage
    # (After Alois P. Heinz)
    @CachedFunction
    def b(n, k):
        if k == 0: return [1]
        w = b(n-1, k) if kPeter Luschny, Jul 29 2013

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.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Apr 29 2004

Keywords

Comments

The leading diagonal and the first column are given by A003418 with a suitable offset 0 or 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
Showing 1-2 of 2 results.