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