Pagini recente » Cod sursa (job #977997) | Cod sursa (job #1288592) | Rating UAIC Motroi Ionita Vintur (ClownFiesta) | Cod sursa (job #1554473) | Cod sursa (job #2547780)
#include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("fractii.in","r",stdin);
freopen("fractii.out","w",stdout);
int N, P, P_copy, total, n;
cin >> N;
n = 0;
total = ((N-1)*N)/2;
for ( P = 2; P <= N/2; ++P )
{
for ( P_copy = 2; P_copy <= N; P_copy += P_copy )
++n;
++P;
P_copy = P;
}
total = (total - n)*2+1;
cout << total;
return 0;
}