
Paul B. answered 01/22/23
Let's talk physics and math!
Hi Emma,
To make things easier, let's start off by clarifying the scope of what we're looking for: natural numbers.
This includes 1, 2, 3, etc, but does not include 0 (as mod 0 would imply dividing by 0, which isn't allowed).
Finding a lower bound
Everything is congruent to 0 mod 1, since by definition, everything is divisible by 1. Therefore, we have at least ONE m such that your congruence is true.
Finding an upper bound
Next up, consider when m > 2022. In this case, no matter what m is, 2022 ≡ 2022 (mod m). Great! This means that for all m > 2022, there is only one such m that satisfies the congruence. If 2022 ≡ m-1 (mod m), then simple arithmetic tells us 2023 ≡ m (mod m) ⇒ m=2023.
Not only have we found two values for m, but we now know that there are finitely many.
Finding 1 < m < 2023
Let's revisit a fact from before.
2022 ≡ m-1 (mod m)
2023 ≡ m (mod m)
2023 ≡ 0 (mod m)
What is this last line really saying? Restated, it means that m is any natural number such that it divides 2023 without remainder ⇔ m is any divisor of 2023. Since 2023 = 7*17*17, our divisors are:
- 1
- 7
- 17
- 7*17 = 119
- 17*17 = 289
- 7*17*17 = 2023
Thus we have six possible values for m.
Computational Approach
To check your work, let's make use of our lower and upper bound and write some code to check every integer in between. Here's an example in Python:
And here's that same code in C++: