mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2010-08-29, 19:17   #1090
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Good catch. Related: http://oeis.org/classic/A127435
CRGreathouse is offline   Reply With Quote
Old 2010-08-29, 19:22   #1091
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Code:
for(n=1, 33000, if(isprime(n^2+1)*isprime(n^4+1)*isprime(n+1)==1, print1(n, ", ")))
that's the code that's up on http://www.research.att.com/~njas/sequences/A070325 but why multiply you still have to calculate isprime() to check it, is it faster than && ?
science_man_88 is offline   Reply With Quote
Old 2010-08-29, 19:27   #1092
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Quote:
Originally Posted by CRGreathouse
A number x is in the set of squares and the set of fourth powers.

is the same as

A number x is in the the set of fourth powers.
This one falls apart really quickly.

This would only be true if the set of squares were all fourth powers as well.

25 is a square number and is not a 4th power.
625 is a square number and is a fourth power.

49 is a square number that is not in the set of fourth powers.
2401 is a square number that is in the set of fourth powers.

Last fiddled with by 3.14159 on 2010-08-29 at 19:29
3.14159 is offline   Reply With Quote
Old 2010-08-29, 19:29   #1093
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Back on topic:
Quote:
Originally Posted by 3.14159 View Post
Wait.. Prime fermat numbers are probably finite for any given base. So there are no examples for 120!. That explains it.

For item 16: There are probably no 1000+ digit examples.

Due to that, this is the only category that will be restricted to small primes, 100-750 digits.

If you find me a 1000+ digit example, the restriction will be lifted.
With n = 3 · 2410857, n + 1, n2 + 1, and n4 + 1 are primes. Since 494724 ≥ 1000, I trust you'll be lifting the restriction?
CRGreathouse is offline   Reply With Quote
Old 2010-08-29, 19:31   #1094
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
Originally Posted by CRGreathouse
With n = 3 · 2410857, n + 1, n2 + 1, and n4 + 1 are primes. Since 494724 ≥ 1000, I trust you'll be lifting the restriction?
Restriction lifted.

Last fiddled with by 3.14159 on 2010-08-29 at 19:35
3.14159 is offline   Reply With Quote
Old 2010-08-29, 19:31   #1095
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Good catch. Related: http://oeis.org/classic/A127435
I could see if it was faster but according to a few test of each mine is about 40 times faster and I think I know why based on my knowledge of what the comparison in ASM might be like.

mine uses 2 cmp operations

the one shown uses 1 cmp and 3 mult() ? operations (not sure if this makes the difference though) as i don't know how much slower / faster multiplication is comparing it to a cmp() operation.
science_man_88 is offline   Reply With Quote
Old 2010-08-29, 19:32   #1096
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Quote:
Originally Posted by CRGreathouse View Post
A number x is in the set of squares and the set of fourth powers.

is the same as

A number x is in the the set of fourth powers.
This one falls apart really quickly.
Really? Please provide an example of a member of the set of fourth powers that is not a member of the set of squares and the set of fourth powers, or a member of the set of squares and the set of fourth powers, but not a member of the set of fourth powers.
CRGreathouse is offline   Reply With Quote
Old 2010-08-29, 19:35   #1097
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111010110112 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I could see if it was faster
What is "it"?

Quote:
Originally Posted by science_man_88 View Post
mine uses 2 cmp operations

the one shown uses 1 cmp and 3 mult() ? operations (not sure if this makes the difference though) as i don't know how much slower / faster multiplication is comparing it to a cmp() operation.
imul takes about 4 times as long as cmp. fmul is similar. For older CPUs, cmp was relatively better.
CRGreathouse is offline   Reply With Quote
Old 2010-08-29, 19:37   #1098
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
Originally Posted by CRGreathouse
Really? Please provide an example of a member of the set of fourth powers that is not a member of the set of squares and the set of fourth powers, or a member of the set of squares and the set of fourth powers, but not a member of the set of fourth powers.
There is no such example, but there is no redundancy.

Here's another example:

169 is a square number, and it is not a fourth power.
28561 is a square number, and it is also a fourth power.

Or:

169 is in set x but is not in set y.
28561 is in set x and is in set y.

All members of set y are in set x.
Not all members of set x are in set y.

Last fiddled with by 3.14159 on 2010-08-29 at 19:42
3.14159 is offline   Reply With Quote
Old 2010-08-29, 19:39   #1099
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 is "it"?



imul takes about 4 times as long as cmp. fmul is similar. For older CPUs, cmp was relatively better.
that's why mine gave me times of 10-20 ms but the other gave me 600-650? ms

thanks I think if we want fast code in the OEIS the code shown should be changed for it= http://www.research.att.com/~njas/sequences/A070325

Last fiddled with by science_man_88 on 2010-08-29 at 19:40
science_man_88 is offline   Reply With Quote
Old 2010-08-29, 19:40   #1100
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
There is no such example, but there is no redundancy.

Here's another example:

169 is a square number, and it is not a fourth power.
28561 is a square number, and it is also a fourth power.

Or:

169 is in set x but is not in set y.
28561 is in set x and is in set y.

No redundancies.
Ah, so you just don't understand the word "redundancy".
CRGreathouse is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I sometimes see all the <> formatting commands when I quote or edit? cheesehead Forum Feedback 3 2013-05-25 12:56
Passing commands to PARI on Windows James Heinrich Software 2 2012-05-13 19:19
Ubiquity commands Mini-Geek Aliquot Sequences 1 2009-09-22 19:33
64-bit Pari? CRGreathouse Software 2 2009-03-13 04:22
Are these commands correct? jasong Linux 2 2007-10-18 23:40

All times are UTC. The time now is 23:12.


Fri Aug 6 23:12:41 UTC 2021 up 14 days, 17:41, 1 user, load averages: 4.46, 4.26, 4.07

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.