![]() |
|
|
#144 |
|
Jan 2009
Ireland
2×3×31 Posts |
yes but when you get up to exponents around 40 million you will have lots of exponents "likely" to give a prime.and what about the exponents that arent likely to give a prime but still do,do you want to just forget about these just because according to you,they arent "likely" to be prime?
|
|
|
|
|
|
#145 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
get me a list of primes higher than that and we might try a few lol
also if you don't want to I have a prime finder I can get to for me lol |
|
|
|
|
|
#146 |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
No but people can fill the gaps later
|
|
|
|
|
|
#147 |
|
Jan 2009
Ireland
2×3×31 Posts |
well if you have one,why would i want to do your work for you?
|
|
|
|
|
|
#148 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
also if excel isn't lying to me just over half of all mersennes found to date have digit # 's dividable by 3
|
|
|
|
|
|
#149 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
I'll give you the credit
|
|
|
|
|
|
#150 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
actually maybe by computer is better I bet they have a more accurate log2(3) value if I can get that function to work last time it didn't
|
|
|
|
|
|
#151 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
anyone got a C compiler especially C++ builder ? I'll even pre-make the rest of the needed code for you.
|
|
|
|
|
|
#152 |
|
Dec 2008
72×17 Posts |
|
|
|
|
|
|
#153 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
first it was originally made by someone else someone who helped me on bytes.com forum so talk to them not me if you don't trust it.
|
|
|
|
|
|
#154 |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
Firstly it was written with the help of bytes.com forum -C section secondly if we can get a c99 function from math.h to work we can use it to find what I'm guessing to be about half of all mersenne primes.
#include <stdlib.h> #include <math.h> #include <stdio.h> static int isPrime(int n) { int i, inc= 2; if (n == 2 || n == 3) return 1; if (n%2 == 0 || n%3 == 0) return 0; for (i= 5; i*i <= n; i+= inc, inc= 6-inc) if (!(n%i)) return 0; return 1; } int main() { int file = 0; unsigned int i; FILE *fp; fp=fopen("sample.txt","w"); for (i=3; i < 4294967295; i=i+2){ if (isPrime(i)){ fseek (fp,0,SEEK_END); if (ftell(fp)<67108843) { fprintf(fp,"(2^%d)-1,",i); } else { file=file+1; if (file==1) { fp=fopen("sample1.txt","w"); fprintf(fp,"%d,",i); } if (file==2) { fp=fopen("sample2.txt","w"); fprintf(fp,"%d,",i); } if (file==3) { fp=fopen("sample3.txt","w"); fprintf(fp,"%d,",i); } if (file==4) { fp=fopen("sample4.txt","w"); fprintf(fp,"%d,",i); } if (file==5) { fp=fopen("sample5.txt","w"); fprintf(fp,"%d,",i); } if (file==6) { fp=fopen("sample6.txt","w"); fprintf(fp,"%d,",i); } if (file==7) { fp=fopen("sample7.txt","w"); fprintf(fp,"%d,",i); } if (file==8) { fp=fopen("sample8.txt","w"); fprintf(fp,"%d,",i); } if (file==9) { fp=fopen("sample9.txt","w"); fprintf(fp,"%d,",i); } if (file==10) { fp=fopen("sample10.txt","w"); fprintf(fp,"%d,",i); } if (file==11) { fp=fopen("sample11.txt","w"); fprintf(fp,"%d,",i); } if (file==12) { fp=fopen("sample12.txt","w"); fprintf(fp,"%d,",i); } if (file==13) { fp=fopen("sample13.txt","w"); fprintf(fp,"%d,",i); } } } } return 0; } |
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A Challenge on the net | devarajkandadai | Miscellaneous Math | 0 | 2012-05-31 05:17 |
| When I was your age.....CHALLENGE | petrw1 | Lounge | 14 | 2009-11-23 02:18 |
| rsa-640 challenge | ValerieVonck | Factoring | 58 | 2005-10-24 15:54 |
| Another challenge | R.D. Silverman | Programming | 24 | 2005-07-27 21:08 |
| Who is Challenge? | JuanTutors | PrimeNet | 2 | 2004-07-22 12:56 |