0

Find the number of positive integers $n<2022$ such that $\gcd(2022,n)=2$.

My intuition says that $n$ must be even and use the fact $2022=2\cdot 3 \cdot 337$. But, I don't know how to find it all "easily". Any ideas without manual calculating? Thanks in advanced.

lap lapan
  • 2,188
  • 2
    Hint: How many even numbers are there less than 2022? – sranthrop May 31 '22 at 08:36
  • @sranthrop There are $1010$ numbers. – lap lapan May 31 '22 at 08:39
  • Ok. How many of them are not divisible by 3? – sranthrop May 31 '22 at 08:41
  • @sranthrop $6,12,18,\ldots, 1008$. There are $168$ numbers. – lap lapan May 31 '22 at 08:44
  • @sranthrop $6,12,18,\ldots, 1008$. There are $168$ numbers which is divisible by $3$. So, there are $1010-168=842$ such numbers. – lap lapan May 31 '22 at 08:50
  • @gerr Note the upper limit for the numbers being checked on is $2022$, not $1010$, so you should use that for the check of numbers not divisible by $3$. – John Omielan May 31 '22 at 08:52
  • 1
    Exactly. Once you got the correct number, all you need to do is to also rule out all numbers which are not divisible by 337. – sranthrop May 31 '22 at 08:52
  • Cancelling $2$ reduces to counting naturals $< 1011$ coprime to $1011 = 3\cdot 337,,$ which is $\phi(3\cdot 337) = 2\cdot 336 = 672$ by the linked dupe. – Bill Dubuque May 31 '22 at 09:24
  • Note $,(2022,n)=2\Rightarrow 2\mid n,,$ so $,2 = (2022,n) = \color{#c00}{2}(1011,n/2)!!\overset{\large \div,2}\iff! 1 = (1011,n/2),$ by the linked GCD $\rm\color{#c00}{Distributive\ Law}$. So your problem is just a doubled scaling of the standard counting of coprimes by Euler $\phi$ (totient) – Bill Dubuque May 31 '22 at 09:37
  • 1
    See also the 3rd linked dupe (same methods apply here) – Bill Dubuque May 31 '22 at 09:43

3 Answers3

4

The numbers $n$ that have $\gcd(2022,n) = 2$ are exactly the numbers $2m$ where $\gcd(1011,m) = 1$. Because $1011$ factors as $3 \cdot 337$, there are $\phi(1011) = \phi(3) \cdot \phi(337) = 2 \cdot 336 = 672$ of those below $1011$.

Magdiragdag
  • 15,049
  • I was thinking about the totient function being useful here. In general, is it then true that if you desire to know how many numbers below $N$ that have $(N,n) = k$, then you just want to find $\phi(N/k)$ ? – Eric Snyder May 31 '22 at 09:19
  • Please strive not to post more (dupe) answers to dupes of FAQs, cf. recent site policy announcement here. – Bill Dubuque May 31 '22 at 09:25
  • @BillDubuque Is this really a duplicate? And is it really a duplicate of the question that it is marked a duplicate of? I can quite imagine that the OP does know how to find the number of natural numbers below $n$ that are relatively prime to $n$ using the totient, but doesn't realize that this particular problem can be reduced to that. Now, it may still be that this question is a duplicate of something else and it could use more context, but the intuition of the OP that is has something to do with $n$ being even and $2022$ being $2 \cdot 3 \cdot 337$ is enough context for me. – Magdiragdag May 31 '22 at 09:33
  • @Magdiragdag It is a combination of counting coprimes by Euler phi, and cancelling $2$ by the gcd distributive law. Both results occur here many times. There is nothing novel here. – Bill Dubuque May 31 '22 at 09:39
  • 2
    I added a more specific dupe link. There are surely many more. – Bill Dubuque May 31 '22 at 09:44
1

Now, gcd$(2022,n) =2$ implies that $3$ and $337$ do not divide $n$. So, it all boils down to finding numbers less than $2022$, which are not divisible by $3$ or $337$ but are multiples of $2$. There are $1010$ multiples of $2$ which are less than $2022$. Now, we need to subtract the total number of even multiples of $3$ and $337$ less than $2022$ from $1010$. The total number of even multiples of $3$ are $336$ and for $337$ its $2$. Therefore, $1010-336-2 = 672$.

VVR
  • 479
1

2022 can be written as $2*3*337$. (You're correct till here)

Now, the solution set consists of the numbers below 2022 that are divisible by 2 but not divisible by 3 or 337.

So, how many numbers less than 2022 are divisible be 2?

1010 numbers less than 2022 are divisible by 2.

Now how many numbers are divisible by 6(i.e. Divisible by both 2 and 3)?

I am asking this because I want to eliminate those numbers which are divisible by 3 from the set of the above 1010 numbers.

So, 336 of these 1010 numbers are divisible by 6.(you can try to figure it out how)

Now, how many of these 1010 numbers are divisible by 674(i.e. divisible by both 2 and 337)?

Well, 2 numbers are.

So, if we subtract these elements from 1010, we should get our final answer.

Final answer: 1010-336-2=672

Eureka!