Pagini recente » Cod sursa (job #848390) | Cod sursa (job #1107921) | Cod sursa (job #1839661) | Cod sursa (job #1706950) | Cod sursa (job #1700472)
/********************
Created by Sburly
********************/
#include <fstream>
using namespace std;
int main()
{
ifstream f("fractii.in");
ofstream g("fractii.out");
long long int n;
f >> n;
long long int totient[n+1];
long long int sol = 0;
for (long int i = 1; i <= n; ++i)
totient[i] = i-1;
for (long int i = 2; i <= n; ++i)
{
sol+=totient[i];
for (long int j = 2*i; j <= n; j += i)
totient[j] -= totient[i];
}
g << sol*2+1;
return 0;
}