#include<iostream>
#include<cstdio>
#include<unordered_map>
using namespace std;
const int mod=1e9+7;
typedef long long LL;
int n;
unordered_map<int, int> primes;//质因子值映射成指数大小
void divide(int x)
{
for(int i=2;i<=x/i;i++)
{
while(x%i==0)
{
x/=i;
primes[i]++;
}
}
if(x>1) primes[x]++;
}
/*
如果 N = p1^c1 * p2^c2 * ... *pk^ck
约数个数: (c1 + 1) * (c2 + 1) * ... * (ck + 1)
约数之和: (p1^0 + p1^1 + ... + p1^c1) * ... * (pk^0 + pk^1 + ... + pk^ck)
*/
int main()
{
cin>>n;
while(n--)
{
int x;
scanf("%d", &x);
divide(x);
}
LL res=1;
for(auto it:primes)
{
int p=it.first, a=it.second;
LL t=1;
while(a--) t=(t*p+1)%mod;//秦九韶算法
res=res*t%mod;
}
cout<<res<<endl;
return 0;
}
约数之和
最新推荐文章于 2021-05-23 13:52:00 发布