Hello,

Let n be 24

You're looking for

All i<24 with gcd(i,24)=1 are :

1,2,5,7,11,13,17,19,23

Hence

We already know and

- let's calculate

All i<5 with gcd(i,5)=1 are : 1,2,3,4

---->

------->

- let's calculate

All i<3 with gcd(i,3)=1 are : 1,2

------->

And so on... It's always the same thing : when there is an you don't know the value, get the definition, find all the numbers < i and relatively prime with i and continue...

It's kinda hard to type it on a computer... If you really need all the details, i can help you for some following values