随机512位整数N,不是2的倍数,3或5 [英] random a 512-bit integer N that is not a multiple of 2, 3, or 5

查看:233
本文介绍了随机512位整数N,不是2的倍数,3或5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

,如果你要选择随机512位整数N,不是2的倍数,3或5什么是N是素数的概率是多少? 我不知道这背后的一个算法...我想要做一个项目,但这样的出发点..:)

if you are to choose a random a 512-bit integer N that is not a multiple of 2, 3, or 5 What is the probability that N is prime? i don't know the algorithm behind this one... i'm trying to work on a project but this is the starting point.. :)

推荐答案

素数小于n的数= 2 512 约为N /日志(N)。你正在考虑号的数目为4/15 * n个,所以你正在寻找的概率为15 /(4 *的log(n)),它是约1%。

The number of primes less than n=2512 is approximately n/log(n). The number of numbers you are considering is 4/15*n, so the probability you are looking for is 15/(4*log(n)), which is about 1 %.

这篇关于随机512位整数N,不是2的倍数,3或5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆