mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2010-07-21, 18:55   #100
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
What are you trying to do?
well if you want me to use your code you better tell me how to make it work in pari if it can't I need to find a code that will come up with a formula that proves #2 on my list way back in the thread.
science_man_88 is offline   Reply With Quote
Old 2010-07-21, 18:58   #101
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
well if you want me to use your code you better tell me how to make it work in pari if it can't I need to find a code that will come up with a formula that proves #2 on my list way back in the thread.
My program won't run? What does it say?

You said that it wouldn't take "my" and I told you to upgrade. You did, so I'm not aware of any issues you're having.
CRGreathouse is offline   Reply With Quote
Old 2010-07-21, 19:01   #102
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

@CRG:

For the pseudoprime generator:

pseudo(n)=!isprime(n)&isWPRP(n,2)
forstep(n=2,1e6,if(pseudo(n),print(n)))

??

P.S: Code saved onto document.

@Scienceman: P.S: 690487410473298653431 = 53318149a + 14651927b. a = ?; b = ?

Last fiddled with by 3.14159 on 2010-07-21 at 19:02
3.14159 is offline   Reply With Quote
Old 2010-07-21, 19:18   #103
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

it didn't look like it was doing anything I apparently didn't press enter after the last line lol.
science_man_88 is offline   Reply With Quote
Old 2010-07-21, 19:21   #104
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

597910 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
pseudo(n)=!isprime(n)&isWPRP(n,2)
forstep(n=2,1e6,if(pseudo(n),print(n)))
Something like that, but be sure you're using the isWPRP/isPRP version that returns a value rather than printing.

You'll need to put in a step value to use forstep. In this case you want a step of 2 (and to start at 3):
forstep(n=3,1e6,2, -code goes here-)
CRGreathouse is offline   Reply With Quote
Old 2010-07-21, 19:22   #105
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
@CRG:

For the pseudoprime generator:

pseudo(n)=!isprime(n)&isWPRP(n,2)
forstep(n=2,1e6,if(pseudo(n),print(n)))

??

P.S: Code saved onto document.

@Scienceman: P.S: 690487410473298653431 = 53318149a + 14651927b. a = ?; b = ?
wel I'm guessing that since you won't stop until I answer it's your usual 2 and 3 lol
science_man_88 is offline   Reply With Quote
Old 2010-07-21, 19:22   #106
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
it didn't look like it was doing anything I apparently didn't press enter after the last line lol.
Ah. It works now, though, right? Hopefully it's faster for you as well.

I think you'll find it worthwhile to reverse the logic on that program: print only if an exception is found, rather than on each number. Otherwise it's just going to fill up your screen!
CRGreathouse is offline   Reply With Quote
Old 2010-07-21, 19:27   #107
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
Ah. It works now, though, right? Hopefully it's faster for you as well.

I think you'll find it worthwhile to reverse the logic on that program: print only if an exception is found, rather than on each number. Otherwise it's just going to fill up your screen!
yeah..... i have no clue how to do that lol .

actually so just change everything to not mostly ?

Last fiddled with by science_man_88 on 2010-07-21 at 19:28
science_man_88 is offline   Reply With Quote
Old 2010-07-21, 19:48   #108
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

got it working for that now and I tested this in 6-7 minutes maybe 8 at most


Code:
(16:38) gp > gettime();test(40000000);gettime();
(16:44) gp >
science_man_88 is offline   Reply With Quote
Old 2010-07-21, 19:55   #109
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

You can type ## (then enter) to see how long the last command took. If you type # (then enter) then each command from that point on prints out how long it took.
CRGreathouse is offline   Reply With Quote
Old 2010-07-21, 19:56   #110
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
You can type ## (then enter) to see how long the last command took. If you type # (then enter) then each command from that point on prints out how long it took.
I'll do it again apparently the 4000 test took 16 ms the last time.
science_man_88 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.