Problem Description
Given a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said to be coprime to B if A, B share no common positive divisors except 1.
 
Input
For each test case, there is a line containing a positive integer N(1 ≤ N ≤ 1000000000). A line containing a single 0 follows the last test case.
 
Output
For each test case, you should print the sum module 1000000007 in a line.
 
Sample Input
3 4 0
 
Sample Output
0 2

分析:欧拉函数的引申,小于或等于n的数中,与n互质的数的总和为φ(x) * x / 2。(n>1)

最新文章

  1. 十分钟介绍mobx与react
  2. Solve VS2010 Error "Exceptions has been thrown by the target of an invocation"
  3. ThreaLocal内存泄露的问题
  4. AsyncTask官方学习
  5. iOS知识总结
  6. Junit3与Junit4的区别
  7. MVC下HtmlHelper自带BeginForm表单提交与异步Ajax请求
  8. Sea.js学习1——初识Sea.js
  9. MYSQL查询语句优化
  10. Mac 终端常用命令备忘
  11. apache http server 局域网无法访问
  12. Net中exe之间的消息传递
  13. Linux 安装 Python3.5
  14. JavaScript设计模式之单例模式
  15. 【Python之路】第九篇--Python基础之线程、进程和协程
  16. spring之json数据的接受和发送
  17. 【Flask】 利用uWSGI和Nginx发布Flask应用
  18. Oracle12c:支持通过创建identity columen来实现创建自增列
  19. C# 将object对象转换为实体对象
  20. MyBatis中的缓存1

热门文章

  1. HTML 5 Canvas 参考手册
  2. opencv的学习笔记1
  3. java多线程编程--基础篇
  4. 解决ADB端口占用问题
  5. 机器学习实战-K-nearest neighbors 算法的优缺点
  6. 【request_firmware】 linux内核下载模块固件接口【转】
  7. 学习Linux系列--安装Ubuntu
  8. python协程与异步I/O
  9. Openstack+Kubernetes+Docker微服务实践之路--选型
  10. shiro 简单的身份验证 案例