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 | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
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.