题目:A simple Math Problem | JXNUOJ
描述:
Huanhuan challenges you to a simple math problem.
Define F(x) as the sum of the decimal digits of x.
For example: F(123)=1+2+3=6, F(700)=7+0+0=7.
Huanhuan wants you to calculate the sum of F(j)for every i,j that satisfy1≤j≤i≤n and i,j are coprime.
More formally, calculate n∑ i=1 i∑ j=1 [gcd(j,i)=1]F(j).
欢欢向你提出一个简单的数学问题。
定义一个F(x)为x的十进制数的总和。
例如:F(123)=1+2+3=6, F(700)=7+0+0=7.
欢欢想要你计算 F(j)的和,对于每个i,j满足1≤j≤i≤n 并且i,j是互质的。
更正式点说,计算n∑ i=1 i∑ j=1 [gcd(j,i)=1]F(j).
输入:
There are only one test case with a single integer n(1≤n≤105).
只有一组数据,一个整数n1≤n≤105)
输出:
Print one integer, the answer of ∑i=1n∑j=1i[gcd(j,i)=1]F(j).
输出一个整数,即∑i=1n∑j=1i[gcd(j,i)=1]F(j)的值。
词汇:
decimal 十进制的 coprime 互质的