题目大意:
已知
x=p1e1∗p2e2∗…∗pkek
;
σ(x)=∏i=1kpiei+1−1pi−1
;
求
x∈[1,n]
中,
x
为偶数的个数;
思路:
即
x
存在素因子为奇数次;
∵2ei+1−12−1=2∗p,2ei+1=2∗p+1
; 恒不成立,即因子
2
的个数不影响结果,排除
即
ans=p+q
;
#include <iostream>
#include <cstdio>
#include <cmath>
#define LL long long
using namespace std;
int main()
{
int T;
scanf("%d", &T);
for (int cas = 1; cas <= T; cas++)
{
LL n;
scanf("%lld", &n);
int ans = (int)sqrt(n * 1.0) + (int)sqrt(n * 1.0 / 2);
printf("Case %d: %lld\n", cas, n - ans);
}
}
/*
1000000000000
*/