Problem 3

# Problem_3.py
"""
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
600851475143的最大质因数
"""
from math import sqrt num = 600851475143
size = int(sqrt(num)) + 1 is_prime = [True for i in range(size)] for i in range(2, size):
if is_prime[i]:
j = 2
while i * j < size:
is_prime[i * j] = False
j += 1 for i in range(size - 1, 1, -1):
if is_prime[i] and num % i == 0:
print(i)
break

最新文章

  1. iOS 真机测试 App installation failed
  2. SOA架构设计(转发)
  3. C语言实现的Web服务器(转-kungstriving)
  4. iOS OC内联函数 inline的详解
  5. 【Android 基础】Android中全屏或者取消标题栏
  6. ZOJ 3157 Weapon
  7. vs 折叠跟展开所有方法。
  8. (一)问候Struts2
  9. [Design Pattern] Command Pattern 命令模式
  10. c语言‘\0’ ,‘0’, “0” ,0之间的区别
  11. Thrift搭建分布式微服务1
  12. CSS(四)float 定位
  13. mysql的学习笔记(六)
  14. 【18】如何把数据存储到MongoDB数据库
  15. TC命令流量控制测试(针对具体IP地址和IP协议)
  16. 最短路 CF954D Fight Against Traffic
  17. ant.design初探
  18. Optimizing subroutine calls based on architecture level of called subroutine
  19. 创建Podspec 并且发布到github spec
  20. 性能强劲的Tokyo Cabinet 和 Tokyo Tyrant

热门文章

  1. 不错的题目-n个数连接得到的最大值
  2. 很实用的50个CSS代码片段
  3. # 从零開始搭建Hadoop2.7.1的分布式集群
  4. Spark部分:几个重要的端口汇总
  5. 2015年趋势科技笔试A卷
  6. 如何做URL静态化 和页面的静态化
  7. Swift - 获取当前时间的时间戳(时间戳与时间互相转换)
  8. (Go)02.go 安装delve调试工具测试
  9. Tomcat安全设置与优化详解(非原创)
  10. c语言system()介绍