I got something interesting on this Problem.Generating X values it shows ϕ(N) for N.But i can't evaluate why this picture follows phi function.Can anyone explain me theory behind it? How co-primes are related with skipping X on this problem?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
I got something interesting on this Problem.Generating X values it shows ϕ(N) for N.But i can't evaluate why this picture follows phi function.Can anyone explain me theory behind it? How co-primes are related with skipping X on this problem?
Название |
---|
You number the mirrors with the point of the lazer as 0, next mirror as 1 and so on. Now if you fire the lazer at mirror numbered x it passes through the mirrors x, 2x mod(n), .., nx mod(n) which are all multiples of x taken modulo n. Now let g = gcd(x, n) if g > 1 the light comes back to the source mirror after hitting n / g mirrors (as x * (n / g) mod(n) = n * (x / g) mod(n) = 0). So they are not correct choice and the avaliable mirrors left are those for which gcd(x, n) = 1. Suppose we fired at one of those mirrors and the light comes back to source mirror at kth hit, so we have k * x mod(n) = 0 as (x, n) = 1 inverse of x modulo n exist, multiplying by its inverse we get k = 0 mod(n) which means k = n.
So all those mirrors for which we have gcd(x, n) = 1 are the right choices.
"light comes back to the source mirror after hitting n / g mirrors" ....thanks a lot.