Integer Ordered Triplets

Distinguishing cases, find the number of ordered triplets (x, y, z) of positive integers such that

x+y+z = n

Let S_n be the number of such triplets for n. We can get a first recursive formula by noticing that if x + y + z = n and a, b, c > 1 then (x-1) + (y-1) + (z-1) = n - 3 \land (x-1), (y-1), (z-1) > 0.

From this we deduce that

S_n = S_{n-3} + \lfloor \frac{n-1}{2} \rfloor

as one can easily check that the cases where at least one of x, y, z numbers equals 1 is the integer part of n-1 divided by 2.

Also, notice there is a bijection between x_1 + y_1 + z_1 = n \land x_1 \leq y_1 \leq z_1 and the ordered triplets x + y + z = n \land x < y < z given by x = x_1, y = y_1 + 1, z = z_1 + 2

Hence, we can apply Burnside’s Lemma on S_n with the group of permutations of 3 elements.

In total we have {{n-1} \choose 2} elements, which we can divide into the conjugacy classes of: all different (1), exactly two are equal (2), exactly 3 are equal if possible (3). Only the identity fixes any element in 1, 2 transpositions fix the elements in 2, all 6 transformations fix the element in 3.

If n is not divisible by 3 we see, using the bijection between S_{n-3} and the conjugacy class 1 (just multiply by 6, the number of possible permutations) we get the recursive formula:

S_n = \frac{6S_{n-3} + 2 ( {{n-1} \choose 2} - 6 S_{n-3})}{6}

If n is divisible by 3:

S_n = \frac{6S_{n-3} + 2 ( {{n-1} \choose 2} - 6 S_{n-3} - 1) + 6}{6}

Substituting the previous recursive formula we found at the start we get an explicit formula.

If n is divisible by 3:

S_n = \frac{1}{2}{{n-1} \choose 2} + \frac{1}{6} \lfloor \frac{n-1}{2} \rfloor + \frac{1}{3}

otherwise

S_n = \frac{1}{2}{{n-1} \choose 2} + \frac{1}{6} \lfloor \frac{n-1}{2} \rfloor

Scroll to top