You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
506 B
C++

#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int vis[N];
int main()
{
for (int i = 2; i < N; i++)
for (int j = i + i, t = 2; j < N; j += i, t++)
vis[j] += t;
int n;
while (cin >> n)
{
long long sum = 0;
for (int i = 2; i <= n; i++)
sum += vis[i];
cout << (sum * 4 + n - 1) << endl;
}
return 0;
}