Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/yangmolulu/article/details/82877949
Playing table
SUM [i] i of each factor is stored sum.
Screening
void makeTable(int n){
memset(sum,0,sizeof(sum));
sum[1] = 0;
int i = 2,j;
while(i <= n){
sum[i]++;
j = i + i;
while(j <= n){
sum[j] += i;
j += i;
}
i++;
}
}