和式变换,数学—–:)
先筛欧拉函数,然后枚举因子
#include <bits/stdc++.h>
/*
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
*/
using namespace std;
const double eps = 1e-10;
const double pi = 3.1415926535897932384626433832795;
const double eln = 2.718281828459045235360287471352;
#define f(i, a, b) for (int i = a; i <= b; i++)
#define scan(x) scanf("%d", &x)
#define mp make_pair
#define pb push_back
#define lowbit(x) (x&(-x))
#define fi first
#define se second
#define SZ(x) int((x).size())
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define summ(a) (accumulate(all(a), 0ll))
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
using ll=long long;
ll n,phi[(int)1e5+9],pr[(int)1e5+9],ans,cnt;
const int mod=1e9+7;
bitset<(int)1e5+9> vis;
ll gcd(ll ma,ll mi){return mi?gcd(mi,ma%mi):ma;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
void getphi(int x){
vis.set();
phi[1]=1;
for(int i=2;i<=x;++i){
if(vis[i]){
phi[i]=i-1,pr[++cnt]=i;
}
for(int j=1;j<=cnt&&i*pr[j]<=x;++j){
vis[i*pr[j]]=0;
if(i%pr[j]==0){
phi[i * pr[j]] = phi[i] * pr[j];
break;
}else phi[i*pr[j]]= phi[i] * phi[pr[j]];
}
}
phi[1]=0;
}
vi factors(int x){
set<int>s;
for(int i=1;i*i<=x;++i){
if(x%i==0)s.insert(i);
if(x%i==0&&x%(x/i)==0)s.insert(x/i);
}
return vector<int>(s.begin(), s.end());
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n;
getphi(n);
for(int i=1;i<n;++i){
for(auto it:factors(n-i)){
ans=(ans+lcm(i,it)*phi[(n-i)/it])%mod;
}
}
cout<<ans;
return 0;
}