#include #include #define PP 20000000 using namespace std; vector W; vector F; bool P[PP]; long long answer(long long n) { if (n == 1) return 1; F.clear(); for(int i=0; i 1;) { if (n % W[i] == 0) { F.push_back(W[i]); n /= W[i]; } else { i++; } } if (n > 1) F.push_back(n); long long total = 1, current = 1; for(int i=F.size()-1; i>=0; i--) { //cout << " " << F[i] << endl; current *= F[i]; total += current; } return total; } int main() { for(long long i=2; i> N) { long long total = 0; for(int i=0; i> temp; total += answer(temp); } cout << total << endl; } }