OFFSET
0,2
LINKS
Fausto A. C. Cariboni, Table of n, a(n) for n = 0..50
EXAMPLE
a(4) = 14: {}, {1}, {2}, {3}, {4}, {1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}, {1,2,3}, {1,3,4}, {2,3,4}.
MAPLE
b:= proc(n, s) local sn, m;
m:= nops(s);
sn:= [s[], n];
`if`(n<1, 1, b(n-1, s) +`if`(m*(m+1)/2 = nops(({seq(seq(
ilcm(sn[i], sn[j]), j=i+1..m+1), i=1..m)})), b(n-1, sn), 0))
end:
a:= proc(n) option remember;
b(n-1, [n]) +`if`(n=0, 0, a(n-1))
end:
seq(a(n), n=0..10);
MATHEMATICA
b[n_, s_] := b[n, s] = Module[{sn, m}, m = Length[s]; sn = Append[s, n]; If[n < 1, 1, b[n - 1, s] + If[m*(m + 1)/2 == Length @ Union @ Flatten @ Table[LCM [sn[[i]], sn[[j]]], {i, 1, m}, {j, i+1, m+1}], b[n-1, sn], 0]]]; a[n_] := a[n] = b[n-1, {n}] + If[n == 0, 0, a[n-1]]; Table[ Print["a(", n, ") = ", a[n]]; a[n], {n, 0, 30}] (* Jean-François Alcover, Feb 02 2017, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Oct 05 2011
EXTENSIONS
Terms a(31) and beyond from Fausto A. C. Cariboni, Oct 18 2020
STATUS
approved