| 4 | #include <numeric> |
| 5 | |
| 6 | TEST(UtilsMathTest, FactorsTest) { |
| 7 | for (int m = 1; m <= 50000; m++) { |
| 8 | auto f = factors(m); |
| 9 | int m2 = m; |
| 10 | for (auto x : f) { |
| 11 | ASSERT_EQ(0, m % x); |
| 12 | while (m2 % x == 0) m2 /= x; |
| 13 | } |
| 14 | ASSERT_EQ(1, m2); |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | bool is_primitive_root_naive(int m, int g) { |
| 19 | assert(1 <= g && g < m); |
nothing calls this directly
no test coverage detected