我不知道我在做什麼錯誤,試圖使用Pollard的rho算法來計算素數因子分解。 #include<stdio.h>
#define f(x) x*x-1
int pollard(int);
int gcd(int, int);
int main(void) {
int n;
scanf("%d",&n);
pollard(n);
return 0
爲了找到Schnorr group generator我必須發現三個數p,q和r爲使得: P = QR + 1 p和q是素數 當p和q應該是非常大的素數時,很難找到滿足所有條件的q和r。 我嘗試過使用GNU GMP庫隨機查找q和r,但在我的筆記本電腦上30分鐘內找到的號碼不符合上述標準。 是否有任何快速的方法來找到這樣的數字和Schorr組發生器? 謝謝!我在[當前DSA規格](第一章A1.1.2
對我說的問題是這樣的: 「數字600851475143最大的素數是多少?」 該程序是用來尋找答案就是這用C: #include<math.h> // for remainder because % does not work with double or floats
#include<stdio.h>
main()
{
double x=600851475143,y=3.0;