%I #14 Nov 16 2014 15:06:09
%S 1,1,1,6,4,15,37,81,133,270,565,1200,2449,4961,10014,20083,39585,
%T 77566,152934,305587,617857,1257333,2558837,5180712,10404918,20732162,
%U 41087390,81291644,161136101,320733232,641408052,1287453960,2589099670,5207066575,10459270462
%N Number of compositions of n such that the number of parts and the largest part and the smallest part are pairwise coprime.
%H Alois P. Heinz, <a href="/A199890/b199890.txt">Table of n, a(n) for n = 1..250</a>
%e a(4) = 6: [1,1,1,1], [1,1,2], [1,2,1], [1,3], [2,1,1], [3,1].
%p b:= proc(n, t, g, k) option remember;
%p `if`(n=0, `if`(igcd(g, t)=1 and igcd(k, t)=1 and igcd(g, k)=1, 1, 0),
%p add(b(n-i, t+1, max(i, g), min(i, k)), i=1..n))
%p end:
%p a:= n-> b(n, 0, 0, infinity):
%p seq(a(n), n=1..40);
%t b[n_, t_, g_, k_] := b[n, t, g, k] = If[n == 0, If[GCD[g, t] == 1 && GCD[k, t] == 1 && GCD[g, k] == 1, 1, 0], Sum[b[n-i, t+1, Max[i, g], Min[i, k]], {i, 1, n}]]; a[n_] := b[n, 0, 0, Infinity]; Table[a[n], {n, 1, 40}] (* _Jean-François Alcover_, Nov 05 2014, after _Alois P. Heinz_ *)
%Y Cf. A201218.
%K nonn
%O 1,4
%A _Alois P. Heinz_, Nov 11 2011
|