You're viewing a comment by Mark and its responses.
You're viewing a comment by Mark and its responses.
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
I am being sponsored by A-Writer! If you ever need help with essay writing, look no further than A-Writer! They will help you with your writing in as quickly as 3 hours!
I love to read science books. They make my day and I get ideas for awesome blog posts, such as Busy Beaver, On Functors, Recursive Regular Expressions and many others.
Take a look at my
Amazon wish list, if you're curious about what I have planned reading next, and want to surprise me. :)
If you are interested in advertising on catonmat.net, contact me.
Free tools for coding on Vietstarsoft.com.
Programming homework help.


Nice work! I solved this question using similar methods of scripting to you, but utilizing MySQL when performing the sums. Created a 2 column table where I was running the query:
Had to create an index on column 'p' to speed up the summation of the primes (very slow otherwise!). In the end, once the actual table had been created and indexed by MySQL, the solution popped out in a few more minutes of PHP and BASH script.
Ended up with 4 text files, containing all possible potential numbers. Then used a final bit of scripting piped through ‘less’ to manually locate the final answer:
for i in `awk '{print $1}' 1151.txt`; do grep "^$i$" 1151.txt 775.txt 11.txt 5.txt; echo; done | less … 1151.txt:8256109 1151.txt:8327513 1151.txt:8368331 1151.txt:8429539 775.txt:8429539 11.txt:8429539 5.txt:8429539 1151.txt:8480599 1151.txt:8501039 1151.txt:8582831 …And there’s the answer: 8429539 (for problem 5, 11, 775 and 1151).
And this was all done on a small ITX Linux box with 384Mb of RAM running a VIA Nehemiah 1Ghz cpu. Who needs fast processors and gigs of RAM to solve this!! :-)
Reply To This Comment