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

Let be the number of such triplets for n. We can get a first recursive formula by noticing that if and then .

From this we deduce that

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

Also, notice there is a bijection between and the ordered triplets given by

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

In total we have 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 and the conjugacy class 1 (just multiply by 6, the number of possible permutations) we get the recursive formula:

If n is divisible by 3:

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

If n is divisible by 3:

otherwise