Primal Pi

Stack
Posts: 3
Joined: Sat Aug 28, 2010 3:40 am

Post by Stack »

wodkahack0r wrote:Hm. I found a prime (size 1000 < x < 1200) but it doesn't seem to be the right one. But my program cannot find another prime, which has that much digits :-/
wodkahack0r wrote:Right. Well, then I need to adjust my script and try again.

[later]: Damn typo. Got it now.
UGH. You totally threw me off by two days, I thought it really was 1000<x<1200, because you said you just had a typo. I'm not really blaming you, just expressing my frustration. Actually, I'm quite glad for it, because now I have some sweet python code that runs in just a few >4 hours that I can use for future programming challenges. You can view the code in the "Challenges Solved" section. :o
TheBlackElf
Posts: 2
Joined: Wed Mar 18, 2009 3:27 pm

Post by TheBlackElf »

My run was 511 seconds :P
M4xZ3r0
Posts: 5
Joined: Thu Mar 31, 2011 11:23 am

Post by M4xZ3r0 »

Ok ... I have a problem ... I've got the number, but i can't enter it.

Once I paste it into the answer field an press submit, it just reloads the page without any output ...

Help?
uws8505
Posts: 32
Joined: Sun Jan 23, 2011 8:57 pm

Post by uws8505 »

M4xZ3r0 wrote:Ok ... I have a problem ... I've got the number, but i can't enter it.

Once I paste it into the answer field an press submit, it just reloads the page without any output ...
Normally the submit form should work, but if it fails you can always use the alternative method written in the "About Challenges..." page.
M4xZ3r0
Posts: 5
Joined: Thu Mar 31, 2011 11:23 am

Post by M4xZ3r0 »

uws8505 wrote:
M4xZ3r0 wrote:Ok ... I have a problem ... I've got the number, but i can't enter it.

Once I paste it into the answer field an press submit, it just reloads the page without any output ...
Normally the submit form should work, but if it fails you can always use the alternative method written in the "About Challenges..." page.
Already tried that.

Is the answer is the subsequence or the number of digits? I'm asking because the textfield only takes up to 512 characters and my answer is ... well a little bit bigger :)
BadCop
Posts: 4
Joined: Sun May 29, 2011 7:45 am

challenge damaged?

Post by BadCop »

Hey there,

i submitted my solution with the submit-button -> page was reloaded without right or wrong
i submitted my solution with the url > page was reloaded without right or wrong

is the Challenge damaged?

yours

BadCop
PitDaAnimA
Posts: 1
Joined: Tue May 31, 2011 6:22 pm

Post by PitDaAnimA »

same problem here.. i'm pretty sure i found the correct number but both ways won't work.. submit-button & url.. anyone can help me?

regards
If someone with multiple personalities threatens to kill himself, is it considered a hostage situation?
moose
Posts: 67
Joined: Fri Jul 16, 2010 7:32 pm

Post by moose »

Hi,

I'm solving this challenge at the moment. For those who want to try it, I got some info:
This 547-digit number is not the largest prime in the sequence, but it is a prime:

Code: Select all

141592653589793238462643383279502884197169399375105820974944592307816406
28620899862803482534211706798214808651328230664709384460955058223172535940812
84811174502841027019385211055596446229489549303819644288109756659334461284756
48233786783165271201909145648566923460348610454326648213393607260249141273724
58700660631558817488152092096282925409171536436789259036001133053054882046652
13841469519415116094330572703657595919530921861173819326117931051185480744623
79962749567351885752724891227938183011949129833673362440656643086021394946395
2247371907021
You can verify this within seconds if you got the right algortihm.

ECM can factorize a composite number for you.
You might also want to make damn sure that your program prints the prime every time it finds one. I ran my program for hours just to see that I forgot this little part ...
edit 2: and make sure you write the output to a file! I simply printed the output, ran my Python-script in the bash and gave too much ouput. The result was, that I could not read the last prime, but lots of irrelevant output :-/

Ah, and if you want to count the length of your prime you can use charcounter :D (I guess that those, who are able to solve this challenge can make a charcounter by their own, but it looks so good)

I've found a prime with 1140 characters, but the Website doesn't respond to it. Am I doing something wrong?

edit: Now I've found a prime with much more than 1,500 digits (I don't want to give a spoiler, so I don't give the exact number). Nothing happens when I send this digit with Chrome or Firefox to the server - neither a "correct answer"-message, nor a "'123' is incorrect."-message :-(

It seems like it would only accept messeges up to a size of 513 characters, 514 characters are not accepted.

Try this (font size 2, I don't want to screw up the page layout):

87654321222222222222222221222222222222222222222222222222222222222222222222222222222221122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

Then add, lets say a 9 as first digit. No feedback.


Here are my headers:

Code: Select all

Request URL:http://www.hacker.org/challenge/chal.php?answer=YourLongPrime&id=99&go=Submit
Request Method:GET
Status Code:200 OK


Request Headers
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Cookie:MyCookies
Host:www.hacker.org
User-Agent:Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.124 Safari/534.30


Query String Parameters
answer:YourLongPrime
id:99
go:Submit


Response Headers
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:789
Content-Type:text/html
Date:Sun, 17 Jul 2011 11:09:13 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive:timeout=2, max=100
Pragma:no-cache
Server:Apache
Vary:Accept-Encoding
Last edited by moose on Sun Jul 17, 2011 11:12 am, edited 2 times in total.
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

The challenge asks for the longest subsequence which is a prime number, so if that sequence *were* 2000 digits long, we would have to enter 2000 digits. There is nothing in the challenge which tells us to submit only so many digits/characters (as there is with some other challenges).

If there are indeed longer primes (in the first 2048 digits of pi after the decimal point) than the accepted answer, then the challenge would be faulty and should be corrected.
moose
Posts: 67
Joined: Fri Jul 16, 2010 7:32 pm

Post by moose »

Jup, the challenge is faulty. You can submit the answer, if you know a little bit about PHP, but I guess it was not intended to extend this challenge to PHP-knowledge. ( Just solved it :D )
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

Finally solved it. Phew!

It seems to me the error in the challenge is in this line:

Code: Select all

<p><form name=frm action=chal.php method=GET>
What this should actually be is:

Code: Select all

<p><form name=frm action=chal.php method=POST>
rogger
Posts: 3
Joined: Thu Oct 30, 2008 9:23 pm

Post by rogger »

hmm...
if have just found a large prime with more than 1500 digits as moose suggests but if I change the form to "POST" it just says "'xxx' is incorrect"
any suggestions?

edit:
i just found another prime just a little smaller... maybe there are even more (and bigger ones)...

multitasking rules :D

edit2:
finialy did it, well not easy but with quad power its solveable :D
bspus
Posts: 9
Joined: Sun Sep 04, 2011 5:16 pm

Post by bspus »

This thing with GET and POST really should be fixed. We already have a challenge for that sort of puzzle
Besere
Posts: 12
Joined: Sat Mar 12, 2011 12:58 pm

Post by Besere »

"Looking at the set of all possible subsequences (consecutive digits)"

This is kind of ambiguous to me. Can someone please explain?

Consecutive digits mean numbers like 1111111111111 or 44444444444 right?
So are we look for a number like 777777777777 that is a prime number?

Does "subsequence" mean substring? or does it mean subsequence as in 123 is a subsequence of 18253?
User avatar
MatRush
Posts: 33
Joined: Fri May 13, 2011 1:26 pm
Location: China
Contact:

Post by MatRush »

Besere wrote:"Looking at the set of all possible subsequences (consecutive digits)"

This is kind of ambiguous to me. Can someone please explain?

Consecutive digits mean numbers like 1111111111111 or 44444444444 right?
So are we look for a number like 777777777777 that is a prime number?

Does "subsequence" mean substring? or does it mean subsequence as in 123 is a subsequence of 18253?
s = '123; for every index i, every index j >= i can get a subsequence -> s[i..j].
In fact, it's substring.
Post Reply