mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2006-08-22, 13:02   #12
T.Rex
 
T.Rex's Avatar
 
Feb 2004
France

22×229 Posts
Default

Quote:
Originally Posted by rogue View Post
... my own PPC ASM version
Seems you have a PowerPC version of your program. Can you make it available so that I see how fast it runs on Linux/Power5+ 1.65 GHz ?
T.
T.Rex is offline   Reply With Quote
Old 2006-08-22, 23:46   #13
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

11×577 Posts
Default

Quote:
Originally Posted by T.Rex View Post
Seems you have a PowerPC version of your program. Can you make it available so that I see how fast it runs on Linux/Power5+ 1.65 GHz ?
T.
See attached. You need GMP installed and you need to compile with -m64.

BTW, searched to 2e11 with no new solutions. I stopped as I don't expect another solution anytime soon. I could run it to 1e13 in a couple of weeks, but why waste my resources. Maybe I'll come back to it in the future, but I've got too many things on my plate at the moment that require horsepower.
Attached Files
File Type: zip consec.zip (5.3 KB, 82 views)
rogue is offline   Reply With Quote
Old 2006-08-24, 12:55   #14
T.Rex
 
T.Rex's Avatar
 
Feb 2004
France

22·229 Posts
Default

Thanks.
But ... how do you compile it ?
gcc -m64 consec.c expmod.s mulmod.s
shows problems with // comments in .s files and also when I've removed them (I'm not an expert in compiling assembler ...).
T.

With // comments:
expmod.s:1: Error: junk at end of line, first unrecognized character is `/'

Without // comments:
expmod.s:6: Error: unsupported relocation against r26
T.Rex is offline   Reply With Quote
Old 2006-08-24, 17:37   #15
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

634710 Posts
Default

Quote:
Originally Posted by T.Rex View Post
Thanks.
But ... how do you compile it ?
gcc -m64 consec.c expmod.s mulmod.s
shows problems with // comments in .s files and also when I've removed them (I'm not an expert in compiling assembler ...).
T.

With // comments:
expmod.s:1: Error: junk at end of line, first unrecognized character is `/'

Without // comments:
expmod.s:6: Error: unsupported relocation against r26
Try the compiler option:
-mregnames

After that, use google.
rogue is offline   Reply With Quote
Old 2006-09-15, 01:17   #16
Maybeso
 
Maybeso's Avatar
 
Aug 2002
Portland, OR USA

2×137 Posts
Default

Uh, why do your programs list 7 and 11? They are not solutions.
Quote:
Originally Posted by R. Gerbicz View Post
I've also written a program.
Rogue, the last time is the total computation time=687 seconds up to 2^29,
(this is about 5*10^8) on my machine.

C:\>p190
Searching for solutions up to 2^29
p=2 Time=0.000 sec.
p=3 Time=0.000 sec.
p=5 Time=0.000 sec.
p=7 Time=0.000 sec.
p=11 Time=0.000 sec.
p=8167 Time=0.015 sec.
p=371321 Time=0.468 sec.
Time=687.640 sec.
Maybeso is offline   Reply With Quote
Old 2006-09-15, 06:17   #17
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

22·7·53 Posts
Default

Quote:
Originally Posted by Maybeso View Post
Uh, why do your programs list 7 and 11? They are not solutions.
I'm checking (S(p)*X2)%p, so if S(p) is divisible by p then I get that solution but we can get some false solutions (like 7 and 11), because it is possible that X2 is divisible by p, but S(p) isn't divisible by p. Note that there wasn't other false solutions up to 2e11 or something like that, what Rogue searched and it is easy to write a fast independent program to see if it is a good solution or not.
R. Gerbicz is offline   Reply With Quote
Old 2006-09-15, 19:08   #18
Maybeso
 
Maybeso's Avatar
 
Aug 2002
Portland, OR USA

2·137 Posts
Default

Ok, that makes sense. I was thinking that the magnitude of p compared to that of the lcm factors would prevent false hits for small p, but it seems to prevent them for large p.

Some of the lcm factors:
Code:
7 11 13 37 41 53 73 79 101 137 239 271 4649 9091 9901 21649 333667 513239 909091 265371653 ...
Strange that only 7 and 11 create hits.

I have access to a PICK OS machine, which is string based. Programs, numbers and variables are all dynamic length strings. So I wrote a brute force program for this puzzle in compiled PICK BASIC, with the inner loop like this:
Code:
  M = 1
  FOR N = 2 TO P
    M = MOD(M:N, P)
  NEXT N
  IF M ELSE PRINT P
But the machine is an emulation running on linux, and it's multi-user, so although the code looks pretty, it doesn't run much faster than a program using normal integers and 'manual' concatenation. I do get arbitrary length numbers for free, but time is still the main obstacle.

ps. I could port over your ingenius method, but since it doesn't require concatenation, there would be no advantage.

Bruce

Last fiddled with by Maybeso on 2006-09-15 at 19:12 Reason: post script
Maybeso is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Small but nontrivial prime puzzle mart_r Puzzles 85 2018-02-11 18:55
SQL puzzle Prime95 Programming 1 2017-05-13 16:01
Some puzzle Harrywill Puzzles 4 2017-05-03 05:10
New puzzle about prime wpolly Puzzles 2 2009-07-02 20:27
4 4s puzzle henryzz Puzzles 4 2007-09-23 07:31

All times are UTC. The time now is 18:11.


Fri Jul 16 18:11:44 UTC 2021 up 49 days, 15:58, 1 user, load averages: 2.47, 2.20, 1.88

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.