Enumerate relative prime triplets

48 Views Asked by At

You probably all know that you can easily enumerate all relative prime tuples with the following sequence : $$(a_0,b_0)=(1,0)$$ $$(a_1,b_1)=(0,1)$$ $$(a_2,b_2)=(1,1)$$ And for $n\ge1$ $$(a_{2n+1},b_{2n+1})=(a_{n+1}+b_{n+1},b_{n+1})$$ $$(a_{2n+2},b_{2n+2})=(b_{2n+1},a_{2n+1})$$

Hence the sequence $(1,0), (0,1), (1,1), (2,1), (1,2), (3,1), (1,3), (3,2), (2,3), (4,1), (1,4), (4,3), (3,4), (5,2), (2,5), \dots$

My question is, can I enumerate all relative prime triplets (numbers (a,b,c) such that gcd(a,b,c)=1 like (2,3,5) or (6,10,15)) using a similar process (a recurrence relation, maybe involving more terms) ?