这真是一个耗CPU的运算,怪不得现在因式分解和素数查找现在都用于加密运算。

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?

def isprime(n):
    boolisprime = True
    for i in xrange(2,n):
        if n % i == 0:
            boolisprime = False
    return boolisprime

def primenumber(n):
    i = 2
    x = 1
    while True:
        if isprime(i) == True:
            print i,x
            x += 1
        if x > n:
            break
        i += 1
    return i
print primenumber(10001)

10 001st prime number的更多相关文章

  1. FZU 1649 Prime number or not米勒拉宾大素数判定方法。

    C - Prime number or not Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%I64d & % ...

  2. [LeetCode] Prime Number of Set Bits in Binary Representation 二进制表示中的非零位个数为质数

    Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime ...

  3. [Swift]LeetCode762. 二进制表示中质数个计算置位 | Prime Number of Set Bits in Binary Representation

    Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime ...

  4. 762. Prime Number of Set Bits in Binary Representation二进制中有质数个1的数量

    [抄题]: Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a ...

  5. [LeetCode] 762. Prime Number of Set Bits in Binary Representation_Easy

    Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime ...

  6. [LeetCode&Python] Problem 762. Prime Number of Set Bits in Binary Representation

    Given two integers L and R, find the count of numbers in the range [L, R](inclusive) having a prime ...

  7. 题目1040:Prime Number(第k个素数)

    题目链接:http://ac.jobdu.com/problem.php?pid=1040 详解链接:https://github.com/zpfbuaa/JobduInCPlusPlus 参考代码: ...

  8. 问题 B: Prime Number

    题目描述 Output the k-th prime number. 输入 k≤10000 输出 The k-th prime number. 样例输入 10 50 样例输出 29 229 #incl ...

  9. L - Prime Number(求n内质数的个数)

    Description Write a program which reads an integer n and prints the number of prime numbers which ar ...

随机推荐

  1. (1.1.9)UVA 10930 A-Sequence(模拟)

    /* * UVA_10930_1.cpp * * Created on: 2013年10月7日 * Author: Administrator */ #include <iostream> ...

  2. java常用包

    java的核心类都放在java这个包以及其子包下,java扩展的许多类都放在javax包以及其子包下.这些实用类也就是平时经常说的API(应用程序接口). 以下几个是java语言中常用包 java.l ...

  3. python_Opencv_使用Matplotlib模块

    使用Matplotlib模块 Matplotib 是python 的一个绘图库,里头有各种各样的绘图方法. 之后会陆续了解.先学习怎样用Matplotib 显示图像. 可以放大图像,保存图像. 安装M ...

  4. Android Studio Gradle 缓存目录设置

    ======================================================== 笔者:qiujuer 博客:blog.csdn.net/qiujuer 站点:www. ...

  5. jquery图片滚动

    注:代码来自17sucai网,已去除部分冗余代码,只保留图片效果 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional// ...

  6. C#切割指定区域图片操作

    使用winform制作了一个切割图片的功能,切一些固定大小的图片,比如头像.界面如图: 打开本地图片 OpenFileDialog opdialog = new OpenFileDialog(); o ...

  7. block为什么要用copy,runtime的简单使用

    分享一篇文章:link

  8. python 整型--《Python 3程序开发指南》笔记

    参考:<Python 3程序开发指南> 整数转换函数: bin(i) 返回整数i的二进制表示(字符串) hex(i) 返回i的十六进制表示(字符串) int(x) 将x转换为整数,失败产生 ...

  9. AS 自动生成选择器 SelectorChapek

    简介 https://github.com/inmite/android-selector-chapek 设计师给我们提供好了各种资源,每个按钮都要写一个selector是不是很麻烦? 这么这个插件就 ...

  10. 01-资料管理器(Directory/DirectoryInfo操作文件夹类)

    public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Loa ...