编程介的小学生 2017-08-29 01:17 采纳率: 20.5%
浏览 666
已采纳

The Sum of Unitary Totient

Let d is the divisor of n, then d is called unitary divisor of n if the greatest common divisor of d and n/d is 1.

Let Φ* is the unitary totient function defined as Φ*(n)=(p1a1-1)(p2a2-1)...(prar-1) for n=p1a1p2a2...prar where p1, p2, ..., pr are different prime numbers.

You can also find unitary totient function on this oeis page for more information.

Your task is to calculate the sum of Φ*(1), Φ*(2), ... Φ*(n), which n can be up to 109.

Input

There are about 200 cases. Each case is a positive integer number n in a line. (n≤ 109)

Output

For each case, output the sum of Φ*(1), Φ*(2), ... Φ*(n).

Sample Input

6
99
100
Sample Output

13
3475
3547

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了