数学归纳法
f(x)= 5 * x ^ 13 + 13 * x ^ 5 + k * a * x
f(x+1)= 5 * (x+1) ^ 13 + 13 * (x+1) ^ 5 + k * a * (x+1)按二项式展开
f(x+1)=5*(C(13,13)X^13+C(13,12)X^12+C(13,11)X^11+......+C(13,0))+13*(C(5,5)X^5+C(5,4)X^4+...+C(5,0))+k * a * (x+1)
=f(x)+5*(C(13,12)X^12+C(13,11)X^11+......+C(13,0))+13*(C(5,4)X^4+...+C(5,0))+k*a
=f(x)+5*(C(13,12)X^12+C(13,11)X^11+......C(13,1)X)+13*(C(5,4)X^4+...C(5,1)X)+k*a+18
f(x)/65能整除,而多项式5*(C(13,12)X^12+C(13,11)X^11+......C(13,1)X)+13*(C(5,4)X^4+...C(5,1)X)也能整除65,所以当k*a+18能整除65时即f(x+1)能整除65
#include<iostream>
using namespace std;
int main() {
int k;
while (cin>>k&&k) {
int flag = 1;
for (int a= 1; a <= 65; a++) //a以65为周期
{
if (a*k % 65 == 47)
{
cout<<a<<endl;;
flag = 0;
break;
}
}
if (flag)
cout<<"no"<<endl;
}
return 0;
}