%I #15 Apr 05 2023 16:39:47
%S 0,0,0,1,2,4,5,8,10,13,16,20,23,28,32,37,42,48,53,60,66,73,80,88,95,
%T 104,112,121,130,140,149,160,170,181,192,204,215,228,240,253,266,280,
%U 293,308,322,337,352,368,383,400,416,433,450,468,485,504,522,541,560
%N Number of ordered triples of positive integers summing to n that are either weakly increasing or weakly decreasing.
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,0,-1,-1,1).
%F a(n > 0) = 2*A001399(n - 3) - A079978(n).
%F From _Colin Barker_, Sep 08 2020: (Start)
%F G.f.: x^3*(1 + x + x^2 - x^3) / ((1 - x)^3*(1 + x)*(1 + x + x^2)).
%F a(n) = a(n-1) + a(n-2) - a(n-4) - a(n-5) + a(n-6) for n>6. (End)
%F E.g.f.: (36 - 9*exp(-x) + exp(x)*(6*x^2 + 6*x - 19) - 8*exp(-x/2)*cos(sqrt(3)*x/2))/36. - _Stefano Spezia_, Apr 05 2023
%e The a(3) = 1 through a(8) = 10 triples:
%e (1,1,1) (1,1,2) (1,1,3) (1,1,4) (1,1,5) (1,1,6)
%e (2,1,1) (1,2,2) (1,2,3) (1,2,4) (1,2,5)
%e (2,2,1) (2,2,2) (1,3,3) (1,3,4)
%e (3,1,1) (3,2,1) (2,2,3) (2,2,4)
%e (4,1,1) (3,2,2) (2,3,3)
%e (3,3,1) (3,3,2)
%e (4,2,1) (4,2,2)
%e (5,1,1) (4,3,1)
%e (5,2,1)
%e (6,1,1)
%t Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{3}],LessEqual@@#||GreaterEqual@@#&]],{n,0,30}]
%Y A001399(n - 3) = A069905(n) = A211540(n + 2) counts the unordered case.
%Y 2*A001399(n - 6) = 2*A069905(n - 3) = 2*A211540(n - 1) counts the strict case.
%Y A001399(n - 6) = A069905(n - 3) = A211540(n - 1) counts the strict unordered case.
%Y A329398 counts these compositions of any length.
%Y A218004 counts strictly increasing or weakly decreasing compositions.
%Y A337484 counts neither strictly increasing nor strictly decreasing compositions.
%Y Cf. A000212, A000217, A001840, A014311, A156040, A337461, A337603, A337604.
%K nonn,easy
%O 0,5
%A _Gus Wiseman_, Sep 07 2020