mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2010-07-21, 20:01   #111
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111010110112 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
got it working for that now and I tested this in 6-7 minutes maybe 8 at most
Good, that's similar to what I have (5.5 minutes on a reasonably fast computer).
CRGreathouse is offline   Reply With Quote
Old 2010-07-21, 20:04   #112
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Good, that's similar to what I have (5.5 minutes on a reasonably fast computer).
bad cpu then ? I have one that went obsolete 3 years ago lol.

6mn, 1,812 ms for 40 million ?
156 ms for 40000
1907 for 400,000
29,281 ms. for 4 million

Last fiddled with by science_man_88 on 2010-07-21 at 20:18
science_man_88 is offline   Reply With Quote
Old 2010-07-21, 22:17   #113
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

wow 77-78 posts in one day ?
science_man_88 is offline   Reply With Quote
Old 2010-07-21, 23:33   #114
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Code:
Goldbach(n)={
	my(nn=n+n);
	forprime(x=2,n,if(isprime(nn-x),return(x)));
	0
};
GoldbachMax(n)={
	my(nn=n+n);
	forprime(x=2,default(primelimit),if(isprime(nn-x),return(x)));
	error("Ran out of primes at "n)
};
test(lim)={
	for(n=2,min(lim\2,default(primelimit)),
		if(Goldbach(n),print1(2*n,","))
	);
	for(n=min(lim\2,default(primelimit))+1,lim\2,
		if(GoldbachMax(n),print1(2*n,","))
	)
};

test(4000)
is there a way to take your original code (post 62 out of now 114) and make in into something you can set a I've already checked up to here don't check again thing ?
science_man_88 is offline   Reply With Quote
Old 2010-07-21, 23:38   #115
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
is there a way to take your original code (post 62 out of now 114) and make in into something you can set a I've already checked up to here don't check again thing ?
I don't understand the question.
CRGreathouse is offline   Reply With Quote
Old 2010-07-21, 23:40   #116
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
I don't understand the question.
test(x) does all test up to x if we've already done them is there a way we could give that information to the code ?

Last fiddled with by science_man_88 on 2010-07-21 at 23:59
science_man_88 is offline   Reply With Quote
Old 2010-07-22, 00:17   #117
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
test(x) does all test up to x if we've already done them is there a way we could give that information to the code ?
Ah. Got it. Yes, I do this all the time in my programs. Usually I'd force you to figure out how to do it, but in this case I'll just do it for you -- the funny part with the primelimit makes it a little harder than it would otherwise be.

Code:
test(lim,startAt=2)={
	my(breakpoint=min(lim\2,default(primelimit)));
	startAt=floor(startAt);
	for(n=startAt,breakpoint,
		if(Goldbach(n),print1(2*n,","))
	);
	for(n=max(startAt,breakpoint+1),lim\2,
		if(GoldbachMax(n),print1(2*n,","))
	)
};
So if you've already done up to 4000 and you want to check to 10000, do
Code:
test(10000,4000)
The order of arguments might bother you. You can change them if you like, but I've come to prefer it this way.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 00:36   #118
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Code:
(21:35) gp > test(lim,startAt=2)={
my(breakpoint=min(lim\2,default(primelimit)));
startAt=floor(startAt);
for(n=startAt,breakpoint,
if(Goldbach(n),print1(2*n,","))
);
for(n=max(startAt,breakpoint+1),lim\2,
if(GoldbachMax(n),print1(2*n,","))
)
};
(21:35) gp > test(4000,4)
  *** for: not a function: `Goldbach'.
what happened ?

I figured one problem out. Now it seems to start at twice my low bound.

don't worry about the syntax like that if I truly do learn Asm more I'll have to get used to things like that lol

Last fiddled with by science_man_88 on 2010-07-22 at 00:45
science_man_88 is offline   Reply With Quote
Old 2010-07-22, 01:02   #119
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
what happened ?
Dunno, just reload your file with the programs in it. You can probably just type "\r" and it will reread the last file you read in.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 12:38   #120
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Dunno, just reload your file with the programs in it. You can probably just type "\r" and it will reread the last file you read in.
didn't know a file existed lol. anyway I've got the cut in half method to remember but I'm doing test again.
science_man_88 is offline   Reply With Quote
Old 2010-07-22, 13:13   #121
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
didn't know a file existed lol. anyway I've got the cut in half method to remember but I'm doing test again.
Oh. Well then save the program to a file and read it in. That way you don't lose the program just because you shut down your computer.

My standard file of the gp scripts I load every session (not including my old.gp and various specialized .gp files) is probably 20 pages long. It's not something you'd want to enter manually each time.
CRGreathouse is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Goldbach Conjecture MattcAnderson MattcAnderson 4 2021-04-04 19:21
Factorial and Goldbach conjecture. MisterBitcoin MisterBitcoin 17 2018-01-29 00:50
Goldbach's weak conjecture MattcAnderson MattcAnderson 19 2017-03-21 18:17
Goldbach's conjecture Citrix Puzzles 3 2005-09-09 13:58

All times are UTC. The time now is 04:47.


Fri Aug 6 04:47:10 UTC 2021 up 13 days, 23:16, 1 user, load averages: 2.62, 2.40, 3.11

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.