A007997 a(n) = ceiling((n-3)(n-4)/6).
0, 0, 1, 1, 2, 4, 5, 7, 10, 12, 15, 19, 22, 26, 31, 35, 40, 46, 51, 57, 64, 70, 77, 85, 92, 100, 109, 117, 126, 136, 145, 155, 166, 176, 187, 199, 210, 222, 235, 247, 260, 274, 287, 301, 316, 330, 345, 361, 376, 392, 409, 425, 442, 460, 477, 495, 514, 532, 551, 571, 590, 610
Offset: 3
A337484 Number of ordered triples of positive integers summing to n that are neither strictly increasing nor strictly decreasing.
0, 0, 0, 1, 3, 6, 8, 13, 17, 22, 28, 35, 41, 50, 58, 67, 77, 88, 98, 111, 123, 136, 150, 165, 179, 196, 212, 229, 247, 266, 284, 305, 325, 346, 368, 391, 413, 438, 462, 487, 513, 540, 566, 595, 623, 652, 682, 713, 743, 776, 808, 841, 875, 910, 944, 981, 1017
Offset: 0
Keywords
Examples
The a(3) = 1 through a(7) = 13 triples: (1,1,1) (1,1,2) (1,1,3) (1,1,4) (1,1,5) (1,2,1) (1,2,2) (1,3,2) (1,3,3) (2,1,1) (1,3,1) (1,4,1) (1,4,2) (2,1,2) (2,1,3) (1,5,1) (2,2,1) (2,2,2) (2,1,4) (3,1,1) (2,3,1) (2,2,3) (3,1,2) (2,3,2) (4,1,1) (2,4,1) (3,1,3) (3,2,2) (3,3,1) (4,1,2) (5,1,1)
Crossrefs
A140106 is the unordered case.
A242771 allows strictly increasing but not strictly decreasing triples.
A337481 counts these compositions of any length.
A001399(n - 6) counts unordered strict triples.
A069905 counts unordered triples.
A218004 counts strictly increasing or weakly decreasing compositions.
A332745 counts partitions with weakly increasing or weakly decreasing run-lengths.
A332835 counts compositions with weakly increasing or weakly decreasing run-lengths.
A337483 counts triples either weakly increasing or weakly decreasing.
Programs
-
Mathematica
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{3}],!Less@@#&&!Greater@@#&]],{n,0,15}]
Formula
Conjectures from Colin Barker, Sep 13 2020: (Start)
G.f.: x^3*(1 + 2*x + 2*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)
A337482 Number of compositions of n that are neither strictly increasing nor weakly decreasing.
0, 0, 0, 0, 2, 7, 18, 45, 101, 219, 461, 957, 1957, 3978, 8036, 16182, 32506, 65202, 130642, 261601, 523598, 1047709, 2096062, 4192946, 8386912, 16775117, 33551832, 67105663, 134213789, 268430636, 536865013, 1073734643, 2147474910, 4294956706, 8589921771
Offset: 0
Keywords
Comments
A composition of n is a finite sequence of positive integers summing to n.
Examples
The a(4) = 2 through a(4) = 18 compositions: (112) (113) (114) (121) (122) (132) (131) (141) (212) (213) (1112) (231) (1121) (312) (1211) (1113) (1122) (1131) (1212) (1221) (1311) (2112) (2121) (11112) (11121) (11211) (12111)
Crossrefs
Programs
-
Mathematica
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!Less@@#&&!GreaterEqual@@#&]],{n,0,15}]
A242771 Number of integer points in a certain quadrilateral scaled by a factor of n (another version).
0, 0, 1, 3, 6, 9, 14, 19, 25, 32, 40, 48, 58, 68, 79, 91, 104, 117, 132, 147, 163, 180, 198, 216, 236, 256, 277, 299, 322, 345, 370, 395, 421, 448, 476, 504, 534, 564, 595, 627, 660, 693, 728, 763, 799, 836, 874, 912, 952, 992, 1033, 1075, 1118, 1161, 1206
Offset: 1
Keywords
Comments
The quadrilateral is given by four vertices [(1/2, 1/3), (0, 1), (0, 0), (1, 0)] as an example on page 22 of Ehrhart 1967. Here the open line segment from (1/2, 1/3) to (0, 1) is included but the rest of the boundary is not. The sequence is denoted by d'(n).
From Gus Wiseman, Oct 18 2020: (Start)
Also the number of ordered triples of positive integers summing to n that are not strictly increasing. For example, the a(3) = 1 through a(7) = 14 triples are:
(1,1,1) (1,1,2) (1,1,3) (1,1,4) (1,1,5)
(1,2,1) (1,2,2) (1,3,2) (1,3,3)
(2,1,1) (1,3,1) (1,4,1) (1,4,2)
(2,1,2) (2,1,3) (1,5,1)
(2,2,1) (2,2,2) (2,1,4)
(3,1,1) (2,3,1) (2,2,3)
(3,1,2) (2,3,2)
(3,2,1) (2,4,1)
(4,1,1) (3,1,3)
(3,2,2)
(3,3,1)
(4,1,2)
(4,2,1)
(5,1,1)
A001399(n-6) counts the complement (unordered strict triples).
A140106 is the unordered version.
A337484 is the case not strictly decreasing either.
A001399(n-6) counts unordered strict triples.
A069905 counts unordered triples.
A218004 counts strictly increasing or weakly decreasing compositions.
A337483 counts triples either weakly increasing or weakly decreasing.
(End)
Examples
G.f. = x^3 + 3*x^4 + 6*x^5 + 9*x^6 + 14*x^7 + 19*x^8 + 25*x^9 + 32*x^10 + ...
Links
- E. Ehrhart, Sur un problème de géométrie diophantienne linéaire I, (Polyèdres et réseaux), J. Reine Angew. Math. 226 1967 1-29. MR0213320 (35 #4184).
- E. Ehrhart, Sur un problème de géométrie diophantienne linéaire I, (Polyèdres et réseaux), J. Reine Angew. Math. 226 1967 1-29. MR0213320 (35 #4184). [Annotated scanned copy of pages 16 and 22 only]
- E. Ehrhart, Sur un problème de géométrie diophantienne linéaire II. Systemes diophantiens lineaires, J. Reine Angew. Math. 227 1967 25-49. [Annotated scanned copy of pages 47-49 only]
- Wikipedia, Ehrhart polynomial
- Index entries for linear recurrences with constant coefficients, signature (1,1,0,-1,-1,1).
Programs
-
Magma
[Floor((5*n-7)*(n-1)/12): n in [1..60]]; // Vincenzo Librandi, Jun 27 2015
-
Mathematica
a[ n_] := Quotient[ 7 - 12 n + 5 n^2, 12]; a[ n_] := With[ {o = Boole[ 0 < n], c = Boole[ 0 >= n], m = Abs@n}, Length @ FindInstance[ 0 < c + x && 0 < c + y && (2 x < c + m && 4 x + 3 y < o + 3 m || m < o + 2 x && 2 x + 3 y < c + 2 m), {x, y}, Integers, 10^9]]; LinearRecurrence[{1,1,0,-1,-1,1},{0,0,1,3,6,9},90] (* Harvey P. Dale, May 28 2015 *) Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{3}],!Less@@#&]],{n,0,15}] (* Gus Wiseman, Oct 18 2020 *)
-
PARI
{a(n) = (7 - 12*n + 5*n^2) \ 12};
-
PARI
{a(n) = if( n<0, polcoeff( x * (2 + x^2 + x^3 + x^4) / ((1 - x)^2 * (1 - x^6)) + x * O(x^-n), -n), polcoeff( x^3 * (1 + x + x^2 + 2*x^4) / ((1 - x)^2 * (1 - x^6)) + x * O(x^n), n))};
A337698 Number of compositions of n that are not strictly increasing.
0, 0, 1, 2, 6, 13, 28, 59, 122, 248, 502, 1012, 2033, 4078, 8170, 16357, 32736, 65498, 131026, 262090, 524224, 1048500, 2097063, 4194200, 8388486, 16777074, 33554267, 67108672, 134217506, 268435200, 536870616, 1073741484, 2147483258, 4294966848, 8589934080
Offset: 0
Keywords
Examples
The a(2) = 1 through a(5) = 13 compositions: (11) (21) (22) (32) (111) (31) (41) (112) (113) (121) (122) (211) (131) (1111) (212) (221) (311) (1112) (1121) (1211) (2111) (11111)
Crossrefs
A000009 counts the complement.
A047967 is the unordered version.
A056823 is the weak version.
A140106 counts the unordered case of length 3.
A242771 counts the case of length 3.
A333255 is the complement of a ranking sequence (using standard compositions A066099) for these compositions.
A337481 counts these compositions that are not strictly decreasing.
A337482 counts these compositions that are not weakly decreasing.
A218004 counts strictly increasing or weakly decreasing compositions.
Programs
-
Mathematica
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!Less@@#&]],{n,0,15}]
Formula
a(n) = 2^(n-1) - A000009(n) for n > 0.
Comments
Examples
References
Links
Crossrefs
Programs
Haskell
Maple
Mathematica
PARI
Formula