![]() |
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?
|
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 |
No but people can fill the gaps later
|
well if you have one,why would i want to do your work for you?
|
also if excel isn't lying to me just over half of all mersennes found to date have digit # 's dividable by 3
|
I'll give you the credit
|
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
|
anyone got a C compiler especially C++ builder ? I'll even pre-make the rest of the needed code for you.
|
[QUOTE=science_man_88;186397]anyone got a C compiler especially C++ builder ? I'll even pre-make the rest of the needed code for you.[/QUOTE]
I wouldn't trust your trivial and meaningless code. |
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.
|
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; } |
| All times are UTC. The time now is 05:53. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.