OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..60
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.
EXAMPLE
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.
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 *)
PROG
(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)]
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Jul 30 2013
STATUS
approved