By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

What is the 10 001st prime number?

max1 = 10001
a = [2]
i = 3
while len(a) < max1:
flag = 0
for j in a:
if j > i**0.5:
break
if i%j == 0:
flag = 1
break
if flag == 0:
a.append(i)
i+=2 print(a[-1])

Problem 7: 10001st prime的更多相关文章

  1. (Problem 49)Prime permutations

    The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual ...

  2. (Problem 7)10001st prime

    By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. ...

  3. algorithm@ Sieve of Eratosthenes (素数筛选算法) & Related Problem (Return two prime numbers )

    Sieve of Eratosthenes (素数筛选算法) Given a number n, print all primes smaller than or equal to n. It is ...

  4. projecteuler 10001st prime (求出第10001个质数)

    By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. ...

  5. Problem 3: Largest prime factor

    The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 60085 ...

  6. Project Euler:Problem 41 Pandigital prime

    We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly o ...

  7. Python练习题 035:Project Euler 007:第10001个素数

    本题来自 Project Euler 第7题:https://projecteuler.net/problem=7 # Project Euler: Problem 7: 10001st prime ...

  8. poj 3126 Prime Path bfs

    题目链接:http://poj.org/problem?id=3126 Prime Path Time Limit: 1000MS   Memory Limit: 65536K Total Submi ...

  9. POJ3126 Prime Path —— BFS + 素数表

    题目链接:http://poj.org/problem?id=3126 Prime Path Time Limit: 1000MS   Memory Limit: 65536K Total Submi ...

随机推荐

  1. poj1676

    保存不完整数字可能对应的数字,注意小时<24,分钟小于59. AC代码 #include <stdio.h> #include <vector> using namesp ...

  2. Scss 与 Sass 是什么,他们的区别在哪里?

    转载自:http://yunkus.com/difference-between-scss-sass/ 要想了解Scss 与 Sass 是什么以及他们的区别又在哪里,我们不过不先从他们各自的定义说起. ...

  3. js-对象的重要概念

    抽象 抽象是通过特定的实例抽取共同特征以后形成概念的过程.它强调主要特征,忽略次要特征.一个对象是现实世界中一个实体的抽象. 对象三个特性 1.封装 把客观事物封装成抽象的类,隐藏属性和方法的实现细节 ...

  4. webdirver.Chrom() selenium webdirver调用谷歌浏览器的问题解决

    第一个坑: 没有将谷歌驱动放到   /usr/local/bin  目录下 第二个坑: 没有将谷歌浏览器.exe放在    /usr/local/bin  目录下(注意:驱动和浏览器在一个路径下才能使 ...

  5. Nginx 常用配置

    Nginx的负载均衡方式 1.轮询(默认) 每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,能自动剔除. 2.weight 指定轮询几率,weight和访问比率成正比,用于后端 ...

  6. jmockit mock 类的static 属性

    final Object[] originValue = new Object[1];try{ new Expectations(XXStatic.class){ { originValue[0] = ...

  7. java小白也能懂的面向对象

    类是对一组具有共同特征和行为的对象的抽象描述. 理解 [1]类是专门用于描述现实生活中的事物的. [2]类描述的事物都具有共同的特征和行为. [3]类就是我们通常所说的 “类型” ,描述的是一个群体性 ...

  8. package.json bin的作用

    许多包有一个或多个可执行文件(executable),他们希望直接导入到全局路径里面,这样可以直接使用,npm很容易达到这点, A lot of packages have one or more e ...

  9. svn 的权限配置

    #分配用户所属组 g_admin=admin g_ui=zhangsan,lisi g_code=wangwu g_test=zhaoliu,qianqi #分配目录权限 #表示项目根目录 [/] @ ...

  10. 菜鸡学C语言之真心话大冒险

    题目描述 Leslie非常喜欢真心话大冒险的游戏.这一次游戏的规则有些不同.每个人都有自己的真心话,一开始每个人也都只知道自己的真心话.每一轮每个人都告诉指定的一个人他所知道的所有真心话,那么Lesl ...