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.

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}.

This page as a plain text file.
%I A181853 #39 Sep 05 2023 21:23:57
%S A181853 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,
%T A181853 494,282,60,1,28,288,1380,3245,3740,2034,420,1,36,456,2716,8293,13268,
%U A181853 11338,4908,840,1,45,726,5578,22207,47351,57598,40602,15564,2520
%N 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}.
%C A181853 The C(n,k) are also called combinations of n with size k (see A181842).
%C A181853 Main diagonal gives: A003418. Lower diagonal gives: A094308. Column k=1 gives: A000217. - _Alois P. Heinz_, Jul 29 2013
%H A181853 Alois P. Heinz, <a href="/A181853/b181853.txt">Rows n = 0..46, flattened</a>
%e A181853 [0]   1
%e A181853 [1]   1    1
%e A181853 [2]   1    3     2
%e A181853 [3]   1    6    11     6
%e A181853 [4]   1   10    31    34    12
%e A181853 [5]   1   15    81   189   182    60
%e A181853 [6]   1   21   141   393   494   282   60
%p A181853 with(combstruct):
%p A181853 a181853_row := proc(n) local k,L,l,R,comb;
%p A181853 R := NULL;
%p A181853 for k from 0 to n do
%p A181853    L := 0;
%p A181853    comb := iterstructs(Combination(n),size=k):
%p A181853    while not finished(comb) do
%p A181853       l := nextstruct(comb);
%p A181853       L := L + ilcm(op(l));
%p A181853    od;
%p A181853    R := R,L;
%p A181853 od;
%p A181853 R end:
%p A181853 # second Maple program:
%p A181853 b:= proc(n, k) option remember; `if`(k=0, [1],
%p A181853      [`if`(k<n, b(n-1, k), [])[], seq(ilcm(c, n), c=b(n-1, k-1))])
%p A181853     end:
%p A181853 T:= (n, k)-> add(c, c=b(n, k)):
%p A181853 seq(seq(T(n, k), k=0..n), n=0..10);  # _Alois P. Heinz_, Jul 29 2013
%p A181853 # third Maple program:
%p A181853 b:= proc(n, m) option remember; expand(`if`(n=0, m,
%p A181853       b(n-1, ilcm(m, n))*x+b(n-1, m)))
%p A181853     end:
%p A181853 T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 1)):
%p A181853 seq(T(n), n=0..10);  # _Alois P. Heinz_, Sep 05 2023
%t A181853 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 *)
%o A181853 (Sage) # (After Alois P. Heinz)
%o A181853 @CachedFunction
%o A181853 def b(n, k):
%o A181853     if k == 0: return [1]
%o A181853     w = b(n-1, k) if k<n else [0]
%o A181853     return w + [lcm(c,n) for c in b(n-1, k-1)]
%o A181853 def T(n, k): return add(b(n, k))
%o A181853 flatten([[T(n, k) for k in (0..n)] for n in (0..10)])
%o A181853 # _Peter Luschny_, Jul 29 2013
%Y A181853 Row sums give A226037.
%Y A181853 Cf. A065567, A096179, A181854.
%K A181853 nonn,tabl
%O A181853 0,5
%A A181853 _Peter Luschny_, Dec 06 2010