%I #35 Mar 27 2022 03:47:49
%S 0,0,0,2,2,4,10,12,18,26,56,64,100,132,192,350,434,616,850,1176,1554,
%T 2750,3296,4756,6292,8760,11304,15602,24314,30460,41866,55740,74874,
%U 98042,130808,168424,257404,315972,431064,558326,751490,958264,1277866,1621272,2123586,3020630,3768440
%N Number of compositions (ordered partitions) of n into at least 2 distinct positive parts.
%C Inspired and generalized from Kakuro game, a Japanese crossword type game where cells must be filled with different digits 1..9 adding up to the clues.
%C If permutations are considered equivalent then a(n) = A111133(n) = A000009(n) - 1.
%H César Eliud Lozada, <a href="/A216695/a216695.pdf">Illustration for terms up to n=13</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Kakuro">Kakuro</a>.
%F a(n) = A032020(n) - 1.
%F G.f.: (Sum_{k>=0} k!*x^((k^2+k)/2) / Product_{j=1..k} (1-x^j)) - 1/(1-x). - _Joerg Arndt_, Sep 17 2012
%e a(4)=2 because 4 = 1+3 = 3+1 (2 ways).
%e a(6)=10 because 6 = 1+5 = 2+4 = 4+2 = 5+1 = 1+2+3 = 1+3+2 = 2+1+3 = 2+3+1 = 3+1+2 = 3+2+1 (10 ways).
%t nc[n_]:=Total[Length[#]!&/@Select[IntegerPartitions[n],Length[#]>1&&Max[ Tally[ #][[All,2]]]==1&]]; Array[nc,50,0] (* _Harvey P. Dale_, May 27 2018 *)
%o (PARI)
%o N=66; x='x+O('x^N);
%o gf=sum(k=0,N, k!*x^((k^2+k)/2) / prod(j=1,k, 1-x^j)) - 1/(1-x);
%o v=Vec(gf);
%o vector(#v+1,n,if(n==1,0,v[n-1]))
%o /* _Joerg Arndt_, Sep 17 2012 */
%Y Cf. A000009, A032020, A111133.
%K nonn
%O 0,4
%A _César Eliud Lozada_, Sep 16 2012
%E More terms from _Joerg Arndt_, Sep 17 2012
|