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?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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?
Name |
---|
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.