A337483 Number of ordered triples of positive integers summing to n that are either weakly increasing or weakly decreasing.
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, 104, 112, 121, 130, 140, 149, 160, 170, 181, 192, 204, 215, 228, 240, 253, 266, 280, 293, 308, 322, 337, 352, 368, 383, 400, 416, 433, 450, 468, 485, 504, 522, 541, 560
Offset: 0
Examples
The a(3) = 1 through a(8) = 10 triples: (1,1,1) (1,1,2) (1,1,3) (1,1,4) (1,1,5) (1,1,6) (2,1,1) (1,2,2) (1,2,3) (1,2,4) (1,2,5) (2,2,1) (2,2,2) (1,3,3) (1,3,4) (3,1,1) (3,2,1) (2,2,3) (2,2,4) (4,1,1) (3,2,2) (2,3,3) (3,3,1) (3,3,2) (4,2,1) (4,2,2) (5,1,1) (4,3,1) (5,2,1) (6,1,1)
Links
- Index entries for linear recurrences with constant coefficients, signature (1,1,0,-1,-1,1).
Crossrefs
Programs
-
Mathematica
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{3}],LessEqual@@#||GreaterEqual@@#&]],{n,0,30}]
Formula
From Colin Barker, Sep 08 2020: (Start)
G.f.: x^3*(1 + x + x^2 - x^3) / ((1 - x)^3*(1 + x)*(1 + x + x^2)).
a(n) = a(n-1) + a(n-2) - a(n-4) - a(n-5) + a(n-6) for n>6. (End)
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