mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2009-08-18, 20:10   #144
Dougal
 
Dougal's Avatar
 
Jan 2009
Ireland

2×3×31 Posts
Default

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?
Dougal is offline   Reply With Quote
Old 2009-08-18, 20:12   #145
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

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
science_man_88 is offline   Reply With Quote
Old 2009-08-18, 20:13   #146
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

No but people can fill the gaps later
science_man_88 is offline   Reply With Quote
Old 2009-08-18, 20:14   #147
Dougal
 
Dougal's Avatar
 
Jan 2009
Ireland

2×3×31 Posts
Default

well if you have one,why would i want to do your work for you?
Dougal is offline   Reply With Quote
Old 2009-08-18, 20:17   #148
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

also if excel isn't lying to me just over half of all mersennes found to date have digit # 's dividable by 3
science_man_88 is offline   Reply With Quote
Old 2009-08-18, 20:18   #149
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

I'll give you the credit
science_man_88 is offline   Reply With Quote
Old 2009-08-18, 20:20   #150
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

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
science_man_88 is offline   Reply With Quote
Old 2009-08-18, 20:24   #151
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

anyone got a C compiler especially C++ builder ? I'll even pre-make the rest of the needed code for you.
science_man_88 is offline   Reply With Quote
Old 2009-08-18, 20:40   #152
flouran
 
flouran's Avatar
 
Dec 2008

72×17 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
anyone got a C compiler especially C++ builder ? I'll even pre-make the rest of the needed code for you.
I wouldn't trust your trivial and meaningless code.
flouran is offline   Reply With Quote
Old 2009-08-18, 20:44   #153
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

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.
science_man_88 is offline   Reply With Quote
Old 2009-08-18, 20:47   #154
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

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;
}
science_man_88 is offline   Reply With Quote
Reply

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

All times are UTC. The time now is 05:53.


Fri Aug 6 05:53:29 UTC 2021 up 14 days, 22 mins, 1 user, load averages: 4.41, 3.60, 3.21

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.