You are given an integer n. Please output the answer of modulo 998244353. n is represented in the form of factorization.
φ(n) is Euler’s totient function, and it is defi ned more formally as the number of integers k in the interval 1≤k≤n for which the greatest common divisor gcd(n,k) is equal to 1.
For example, the totatives of n = 9 are the six numbers 1, 2, 4, 5, 7 and 8. They are all co-prime to 9, but the other three numbers in this interval, 3, 6, and 9 are not, because gcd(9,3) = gcd(9,6) = 3 and gcd(9,9) = 9. Therefore, φ(9) = 6. As another example, φ(1) = 1 since for n = 1 the only integer in the interval from 1 to n is 1 itself, and gcd(1,1) = 1.
And there are several formulas for computing φ(n), for example, Euler’s product formula states like:
Master of Phi(数论)
最新推荐文章于 2023-01-19 16:03:29 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)