This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int n;
bool prime(int x) {
if (x == 2) return 1;
for (int i = 2; i * i <= x; i++)
if (x % i == 0) return 0;
return 1;
}
int main() {
cin >> n;
for (int i = 2; i <= n; i++) {
if (!prime(i)) continue;
LL x = i;
int ans = 0;
while (x <= n) ans += n / x, x *= i;
printf("%d %d\n", i, ans);
}
return 0;
}