https://projecteuler.net/problem=5
2016-02-23 21:11
567 查看
欧拉问题集,第五题,最小公倍数
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
Smallest multiple
Problem 5
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
#Smallest multiple #Problem 5 #2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. #What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? #最大公约数 def gcd(a,b): if a < b: return gcd(b,a) if b == 0: return a else: return gcd(b,a%b) #最大公倍数 def hcf(a,b): return a * b / gcd(a,b) #区间最小公倍数 def rangeHcf(start,end): result = start for i in range(start,end+1): result = hcf(result,i) return result print(rangeHcf(1,20))
相关文章推荐
- B树、B-树、B+树、B*树的特点 及其性能比较 http://blog.csdn.net/panghuizl/article/details/6921631
- TCP协议与UDP协议
- 常见网络协议端口号整理
- 基于layer mobile手机端弹出框,询问框(PC端推荐layer和artDialog:http://download.csdn.net/download/cometwo/9437895)
- TCP TimeWait状态详解(比较全)
- Python3网络相关
- 基础网络学习记录
- C++之路进阶——网络流(晨跑)
- 网络编程_InetAddress_InetSocketAddress_URL_爬虫原理JAVA185-186
- 浏览器被劫持到http://hao.169x.cn/?v=108的解决办法
- HttpURLConnection请求
- Caffe下python环境的编译和使用draw_net.py绘制lenet网络结构图
- IOS使用AFNetworking进行网络通信
- 使用HttpClient进行远程接口测试
- 网络编程2---select poll epoll
- Apache2.4之httpd.conf配置详解
- 安卓Xutils3网络工具,注解工具,图片工具和日志工具的使用,以及对网络工具的封装
- java 反射调用类的方法 http://weiliuhong1.iteye.com/blog/1222381
- Servlet和Android网络交互基础(1)
- 通过Java反射调用方法 http://blog.csdn.net/ichsonx/article/details/9108173