mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2010-07-22, 15:38   #133
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
Did you have something particular in mind?

You could get a small speedup by installing (possibly as a second OS rather than replacing your primary) some form of Linux, installing gp2c, running the script through gp2c, and hand-editing the C code to type-specialize, as well as to replace general functions with custom specific functions. But for this problem, most of the time is just spent proving primality, so there's no a whole lot to be done.
is .5*c+/- n in there maybe we can find a way to speed it up with that info.
science_man_88 is offline   Reply With Quote
Old 2010-07-22, 15:41   #134
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
is .5*c+/- n in there maybe we can find a way to speed it up with that info.
As always, I'm open to ideas.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 15:45   #135
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
As always, I'm open to ideas.
i can't even get my original idea to work right lol:

Code:
forstep(c=2,100,[2],for(n=1,.5*c,if(isprime(.5*c+n) && isprime(.5*c-n),print(c))))
gives a isprime error of not integer value in arithmetic function.
science_man_88 is offline   Reply With Quote
Old 2010-07-22, 16:07   #136
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

32208 Posts
Default

Quote:
i can't even get my original idea to work right lol:
My original idea of the prime test let all the pseudoprimes pass.

I somehow construed the Fermat test so that 11 is now occasionally marked off as a composite.

Well, a * b = 11. a =?; b = ?

Ideas: a = 5.5, b = 2.

Resolved: Set base to 2.

Last fiddled with by 3.14159 on 2010-07-22 at 16:08
3.14159 is offline   Reply With Quote
Old 2010-07-22, 16:13   #137
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

t=0;forstep(n=2,400000,[2],forprime(p=2,n/2,t+=isprime(n-p);if(t>0,break())))

this is a alteration of your quick code and performs to 400,000 in (94 ms I think is what i got) the other code took 1907 for a one time test if I looked up my stats properly. so that's about 2000% as fast.

the limitation is the precomputed primes here though.

I love this i tested repeatedly at 100,000 and 1,000,000 and the 100,000 always got 93-94 ms the 1000000 went as low as 891 and never to 940 so in the linear to sub-linear range(I say this because 94 overwhelmed 93 in the 100,000 test) and technically if we get around the precomputed prime thing in under about 1900% the time it takes now we can still have it faster than the other one.

Last fiddled with by science_man_88 on 2010-07-22 at 16:58
science_man_88 is offline   Reply With Quote
Old 2010-07-22, 16:28   #138
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
My original idea of the prime test let all the pseudoprimes pass.

I somehow construed the Fermat test so that 11 is now occasionally marked off as a composite.

Well, a * b = 11. a =?; b = ?

Ideas: a = 5.5, b = 2.

Resolved: Set base to 2.
maybe you should get a test mode where they can pick the base and how far to test up.

or maybe put a for loop around it to test one base at a time up to the given limit.

Last fiddled with by science_man_88 on 2010-07-22 at 16:29
science_man_88 is offline   Reply With Quote
Old 2010-07-22, 16:35   #139
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

110100100002 Posts
Default

Quote:
maybe you should get a test mode where they can pick the base and how far to test up.
This would only be useful for the Miller-Rabin test, as the Fermat test is weak to Carmichael numbers, which satisfy the test in every base except those that are its factors or multiples/powers of its factors.

Last fiddled with by 3.14159 on 2010-07-22 at 16:57
3.14159 is offline   Reply With Quote
Old 2010-07-22, 17:12   #140
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

168010 Posts
Default

Also: If 6n+1, 12n+1, and 18n+1 are prime, (6n+1)(12n+1)(18n+1) = Carmichael number.

My best guess:

(6n+1)(12n+1) = 72n^2 + 6n + 12n + 1 = 72n^2 + 18n + 1

(18n+1)(72n^2 + 18n + 1) = 1296n^3 + 72n^2 + 324n^2 + 18n + 18n + 1

That = 1296n^3 + 396n^2 + 36n + 1

Code!:
Code:
for(n=10^3,3*10^3,(1296n^3 + 396n^2 + 36n + 1),if(numdiv(1296n^3 + 396n^2 + 36n + 1) == 8,print(n))
Refined to:
Code:
b(n) = {
for(n=10^3,3*10^3,(1296n^3 + 396n^2 + 36n + 1, 
if(numdiv(1296n^3 + 396n^2 + 36n + 1) == 8,print(n)))
);
}
I need a bit of assistance here..

Code:
(13:20) gp > b(n) = {
for(n = 10^3, 3*10^3,(1296*n^3 + 396*n^2 + 36*n + 1,
if(numdiv(1296*n^3 + 396*n^2 + 36*n + 1) == 8, print(n)));
}
Code:
***   syntax error, unexpected ')', expecting KPARROW or ',': ...*n^2+36*n+1)==8,print(n)));

Last fiddled with by 3.14159 on 2010-07-22 at 17:23
3.14159 is offline   Reply With Quote
Old 2010-07-22, 17:33   #141
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

Code:
b(n)=for(n=10^3,3*10^3,if(numdiv(1296*n^3+396*n^2+36*n+1)==8,print(n)));
I got this to do nothing but no syntax errors lol

Last fiddled with by science_man_88 on 2010-07-22 at 17:42
science_man_88 is offline   Reply With Quote
Old 2010-07-22, 17:44   #142
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
I got this to do nothing but no syntax errors lol
That's something of an improvement. Keep working at it until PARI recognizes the command and obeys it.

Last fiddled with by 3.14159 on 2010-07-22 at 17:45
3.14159 is offline   Reply With Quote
Old 2010-07-22, 18:10   #143
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
t=0;forstep(n=2,400000,[2],forprime(p=2,n/2,t+=isprime(n-p);if(t>0,break())))

this is a alteration of your quick code and performs to 400,000 in (94 ms I think is what i got) the other code took 1907 for a one time test if I looked up my stats properly. so that's about 2000% as fast.
This code shows that there is some Goldbach partition for some even number up to 400000, not that every even number up to 400000 has a Goldbach partition. It's faster by doing far less.
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:09 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.