英文:
Oakley group 2 prime number contains pi, an irrational number
问题
Oakley 第二组的函数, p = 2^1024 - 2^960 - 1 + 2^64 * ⌊2^894 * π + 129093⌋,产生一个质数。其中包含圆周率π,一个无理数。方程中含有无理数如何产生一个有理数的乘积让我感到好奇。在网上找不到答案。在我的数学结构课上学到,有理数和无理数的乘积是无理数,所以我想知道圆周率如何用来产生一个质数。
英文:
The function for Oakley group 2, p = 2^1024 - 2^960 - 1 + 2^64 * ⌊2^894 * π + 129093⌋, produces a prime number. It contains pi, an irrational number. How can an equation containing an irrational number produce a rational product?
I looked on the internet and could not find an answer. I learned in my mathematical structures class that the product of a rational and irrational number is irrational so this makes me wonder how pi is used to produce a prime.
答案1
得分: 1
Rossum已经在评论中回答了你的问题,但我将更详细地解释一下这个素数的结构。
正如Rossum所说,⌊2^894 * π + 129093⌋
部分中的⌊⌋
表示数学地板函数,它产生小于或等于参数的最大整数。2^1024 - 2^960
产生一个数字,其中前64位是1
。将⌊2^894 * π + 129093⌋
乘以2^64
并减去1
,得到一个数字,其中最后64位是1
。将这两者结合在一起,我们得到一个数字,其中前64位和最后64位都是1,因为在这两者相加时不会进位。
在⌊2^894 * π + 129093⌋
中,π被乘以2^894
以提取896
位(1024-64-64)π的位。+ 129093
只是一个偏移量,使整体结果为素数。
英文:
Rossum already answered your question in the comments, but I'm going to elaborate a bit more on the structure of this prime.
As Rossum says, the ⌊⌋
in the ⌊2^894 * π + 129093⌋
portion denote the mathematical floor function, yielding the largest integer less than or equal to the argument. The 2^1024 - 2^960
produces a number where the first 64 bits are 1
s. Multiplying the ⌊2^894 * π + 129093⌋
by 2^64
and subtracting 1
produces a number where the last 64 bits are 1
s. Combining these, we have a number where the first and last 64 bits are ones, since there will be no carrying in the addition of the two.
Within the ⌊2^894 * π + 129093⌋
, pi is multiplied by 2^894
to extract 896
bits (1024-64-64)bits of pi. The
+ 129093` is just an offset to make the overall result prime.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论