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 | jiangly | 3898 |
2 | tourist | 3840 |
3 | orzdevinwang | 3706 |
4 | ksun48 | 3691 |
5 | jqdai0815 | 3682 |
6 | ecnerwala | 3525 |
7 | gamegame | 3477 |
8 | Benq | 3468 |
9 | Ormlis | 3381 |
10 | maroonrk | 3379 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | Dominater069 | 161 |
4 | Um_nik | 159 |
4 | atcoder_official | 159 |
6 | djm03178 | 157 |
7 | adamant | 153 |
8 | luogu_official | 150 |
9 | awoo | 149 |
10 | TheScrasse | 146 |
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.