Page 2 of 3

Posted: Wed Sep 08, 2010 8:02 pm
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

Posted: Sun Dec 12, 2010 4:52 pm
by TheBlackElf
My run was 511 seconds :P

Posted: Mon Apr 11, 2011 6:47 pm
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?

Posted: Tue Apr 12, 2011 1:14 pm
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.

Posted: Tue Apr 12, 2011 1:39 pm
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 :)

challenge damaged?

Posted: Fri Jun 03, 2011 10:55 pm
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

Posted: Sat Jun 25, 2011 10:05 am
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

Posted: Sat Jul 16, 2011 11:47 pm
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

Posted: Sun Jul 17, 2011 10:56 am
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.

Posted: Sun Jul 17, 2011 11:18 am
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 )

Posted: Sun Jul 24, 2011 1:16 pm
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>

Posted: Sat Sep 17, 2011 8:53 pm
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

Posted: Tue Oct 25, 2011 2:04 pm
by bspus
This thing with GET and POST really should be fixed. We already have a challenge for that sort of puzzle

Posted: Tue Feb 07, 2012 9:47 am
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?

Posted: Tue Feb 07, 2012 11:08 am
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.