编程介的小学生 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条回答

报告相同问题?

悬赏问题

  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services