# How many positive integers $\le 1260$ are relatively prime to $1260$? [duplicate]

This question already has an answer here:

I have no idea how to solve this problem.

Is there a general formula to compute the quantity of such numbers?

## marked as duplicate by Dietrich Burde number-theory StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jan 1 at 10:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

## 3 Answers

As the comment stated, you want to use the Euler's totient function.

A good way to calculate the totient function is the use of the product formula. We first note that the prime factorisation of $$1260 = 2^2 \cdot 3^2 \cdot 5 \cdot 7$$.

We then calculate $$\phi(1260) = 1260 \cdot (1 - \frac{1}{2})(1 - \frac{1}{3})(1 - \frac{1}{5})(1 - \frac{1}{7}) = 288$$.

As Lord Shark the Unknown pointed out, the number of positive integers less than or equal to a given number that are coprime to it is called the Euler Totient Function. The easiest way to calculate this is

$$\varphi (n)=n\prod _{p\mid n}\left(1-{\frac {1}{p}}\right)$$

where the product is over all prime numbers p that divide n. So for 1260, the prime factors are 2,3,5,7 so we have

$$\varphi (1260)=1260\ (1-\frac12)(1-\frac13)(1-\frac15)(1-\frac17) = 288$$

It works like this.

The primes that divide 1260 are 2, 3, 5, 7.

For each of these, there is only one remainder that indicates the number is a multiple of the prime: that is 0.

So the number of co-primes is thus all combinations of non-division, ie

[ (2-1)(3-1)(5-1)(7-1)/2.3.5.7 ] * 1260.

We see the square brackets give 48/210, and this by 1260 gives 288.