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.

A226037 a(n) = Sum_{c in P(n)} lcm(c) where P(n) is the set of all subsets of {1,2,...,n}.

Original entry on oeis.org

1, 2, 6, 24, 88, 528, 1392, 11136, 41856, 192192, 516032, 6192384, 13270272, 185783808, 511526400, 1163742720, 4403449344, 79262088192, 199280729088, 3985614581760, 8463108648960, 19276630732800, 54618972549120, 1310855341178880, 2751134770298880, 17228042511482880
Offset: 0

Views

Author

Peter Luschny, Jul 30 2013

Keywords

Examples

			a(4) = lcm{} + lcm{1} + lcm{2} + lcm{3} + lcm{4} + lcm{1,2} + lcm{1,3} + lcm{1,4} + lcm{2,3} + lcm{2,4} + lcm{3,4} + lcm{1,2,3} + lcm{1,2,4} + lcm{1,3,4} + lcm{2,3,4} + lcm{1,2,3,4} =
  1 + 1 + 2 + 3 + 4 + 2 + 3 + 4 + 6 + 4 + 12 + 6 + 4 + 12 + 12 + 12 = 88.
		

Crossrefs

Row sums of triangle A181853.

Programs

  • Maple
    with(combstruct):
    A226037 := proc(n) local R, c; R := 0; c := iterstructs(Combination(n)):
    while not finished(c) do R := R + ilcm(op(nextstruct(c))) od; R end: seq(A226037(n), n=0..25);
    # second Maple program:
    b:= proc(n, m) option remember; `if`(n=0, m,
          b(n-1, ilcm(m, n))+b(n-1, m))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..25);  # Alois P. Heinz, Sep 05 2023
  • Mathematica
    a[n_] := Total[LCM @@@ Rest[Subsets[Range[n]]]] + 1; Table[Print[an = a[n]]; an, {n, 0, 25}] (* Jean-François Alcover, Jan 15 2014 *)
  • Sage
    # (After Alois P. Heinz)
    @CachedFunction
    def C(n, k):
        if k == 0: return [1]
        w = C(n-1, k) if k < n else [0]
        return w + [lcm(c,n) for c in C(n-1, k-1)]
    def A226037(n): return add(add(C(n, k)) for k in (0..n))
    [A226037(n) for n in (0..20)]

Formula

a(n) = Sum_{k=0..n} Sum_{c in binomial(n,k)} lcm(c) where C(n,k) are the combinations of n with size k.