【题目】
Problem D. Euler FunctionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 596 Accepted Submission(s): 492 Problem Description In number theory, Euler's totient function φ(n) counts the positive integers up to a given integer n that are relatively prime to n . It can be defined more formally as the number of integers k in the range 1≤k≤n for which the greatest common divisor gcd(n,k) is equal to 1 .
Input The first line of the input contains an integer T(1≤T≤100000) , denoting the number of test cases.
Output For each test case, print a single line containing an integer, denoting the answer.
Sample Input
2 1 2
Sample Output
5 7 |
【题解】
暴力打表然后发现除了12346,其他的欧拉数都为合数。
【代码】
#include<stdio.h>
main()
{
long long t,k;
scanf("%lld",&t);
while(t--)
{
scanf("%lld",&k);
if(k==1)
printf("5\n");
else
printf("%lld\n",k+5);
}
}