(Translated by https://www.hiragana.jp/)
A337483 - OEIS
login
A337483
Number of ordered triples of positive integers summing to n that are either weakly increasing or weakly decreasing.
11
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,5
FORMULA
a(n > 0) = 2*A001399(n - 3) - A079978(n).
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
EXAMPLE
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)
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n, {3}], LessEqual@@#||GreaterEqual@@#&]], {n, 0, 30}]
CROSSREFS
A001399(n - 3) = A069905(n) = A211540(n + 2) counts the unordered case.
2*A001399(n - 6) = 2*A069905(n - 3) = 2*A211540(n - 1) counts the strict case.
A001399(n - 6) = A069905(n - 3) = A211540(n - 1) counts the strict unordered case.
A329398 counts these compositions of any length.
A218004 counts strictly increasing or weakly decreasing compositions.
A337484 counts neither strictly increasing nor strictly decreasing compositions.
Sequence in context: A076614 A227800 A144876 * A239517 A231056 A325363
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Sep 07 2020
STATUS
approved