Post: Program that computes the largest prime number ever
05-18-2011, 06:27 AM #1
0xFa1z
Splicer
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys

This small C script can compute 2^43112609-1 which is the biggest ever known prime number (13 million digits)

    int m=167772161,N=1,t[1<<25]={2},a,*p,i,e=34893349,s,c,U=1;g(d,h){for(i=s;i<1<<
24;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*(h?c:1LL)%m,p[s]
=(m+*p-a)*(h?1LL:c)%m,a+=*p,*p++=a%m,c=c*1LL*d%m;}main(){while(e/=2){N*=2;U=U*
1LL*(m+1)/2%m;for(s=N;s/=2Winky Winkyg(17,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;for(s=1
;s<N;s*=2)g(29606852,1);for(a=0,p=t;p<t+NWinky Winkya+=*p<<(e&1),*p++=a%10,a/=10;}while(!
*--p);for(t[0]--;p>=tWinky Winkyputchar(48+*p--);}

You must compile it using a C compiler that supports 64 bit long long type and it will take 2 minutes on a 2.3 ghz CPU



Impress your math teachers :p
(adsbygoogle = window.adsbygoogle || []).push({});
05-18-2011, 07:08 PM #2
kiwimoosical
Bounty hunter
Ahh. Was this idea taken from Eulers Project? Anyways, if you wrote this, gratzi.
05-18-2011, 07:11 PM #3
0xFa1z
Splicer
I didnt write this

The following user thanked 0xFa1z for this useful post:

Relevant
05-18-2011, 07:15 PM #4
Josh_ox3
Treasure hunter
You have given literally no info on this, this is a useless thread, you probably saw this on google.com and thought "yeey something to get my post count up"

Add some more details on how to do this if you can even do it yourself

The following 2 users groaned at Josh_ox3 for this awful post:

Epic?, schnzrs
05-19-2011, 09:20 AM #5
Originally posted by ox3 View Post
You have given literally no info on this, this is a useless thread, you probably saw this on google.com and thought "yeey something to get my post count up"

Add some more details on how to do this if you can even do it yourself


This is a useful post actually, When did you last contribute something other than "How to make a Calculator in VISUAL BASCI" :derp:

The following 4 users say thank you to Relevant for this useful post:

0xFa1z, BuLLeTzZ, kiwimoosical, vSaBoTeuR x

The following user groaned Relevant for this awful post:

Josh_ox3
05-19-2011, 08:41 PM #6
Josh_ox3
Treasure hunter
Originally posted by Relevant View Post
This is a useful post actually, When did you last contribute something other than "How to make a Calculator in VISUAL BASCI" :derp:


Originally posted by xNCK View Post
Dude, shut the **** up when more than half of your posts are useless. Like I give a damn **** you created a shitty C# program to login in into vBulletin forums. For christ sake, you know nothing of computer science, but you do have a big mouth against other members with advanced knowledge of English and Computer Science.



Oops, You must login or register to view this content. <-- That what the site you have made two threads about, next time give credit Smile Can't be asked to have a fight with keyboard warriors like yourselves.

P.S, I was not the person who made a calculator, go do some research before you start having a hissy fit at your computer screen.
05-19-2011, 08:54 PM #7
Originally posted by ox3 View Post
Oops, You must login or register to view this content. <-- That what the site you have made two threads about, next time give credit Smile Can't be asked to have a fight with keyboard warriors like yourselves.

P.S, I was not the person who made a calculator, go do some research before you start having a hissy fit at your computer screen.


Im not having a hissy fit, thats a retarded assumption, im just trying to take the trash out. your making no contribution and then being rude to other members.
05-19-2011, 08:57 PM #8
kiwimoosical
Bounty hunter
Originally posted by ox3 View Post
You have given literally no info on this, this is a useless thread, you probably saw this on google.com and thought "yeey something to get my post count up"

Add some more details on how to do this if you can even do it yourself


Your stupid. All you do is compile it and it prints the highest computable prime number on the screen..

The following user thanked kiwimoosical for this useful post:

vSaBoTeuR x
05-19-2011, 09:01 PM #9
Josh_ox3
Treasure hunter
Originally posted by kiwimoosical View Post
Your stupid. All you do is compile it and it prints the highest computable prime number on the screen..


Originally posted by Relevant View Post
Im not having a hissy fit, thats a retarded assumption, im just trying to take the trash out. your making no contribution and then being rude to other members.


To be honest, i don't really care, I'm stating the obvious.

kiwimoosical, was i speaking to you? and i know how to compile it, its just that most other people on the forum do not, you are the stupid one.
05-19-2011, 09:03 PM #10
Curt
Former Staff
Stop flaming :dumb:

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo