Problem 238
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
Robert_Gerbicz
- Posts: 26
- Joined: Sat Oct 13, 2007 2:44 pm
Problem 238
NB: The first posts in this topic refer to an earlier version of problem #238, which unfortunately had an error.
To fix it, the problem statement was modified. As a result, the (partial) answers posted below are no longer valid.
-Edited by harryh
I think this is a broken problem. My semi brute force code gives the same answers for N=10^8 and N=2*10^8 that my fast code. (for brute force obviously it is not so that easy if you have not got enough RAM, but if you replace the starting value(s) of the sequence then testing is easy).
//so I mean: sum(k=0,10^8,p(k)) and sum(k=0,2*10^8,p(k))
To fix it, the problem statement was modified. As a result, the (partial) answers posted below are no longer valid.
-Edited by harryh
I think this is a broken problem. My semi brute force code gives the same answers for N=10^8 and N=2*10^8 that my fast code. (for brute force obviously it is not so that easy if you have not got enough RAM, but if you replace the starting value(s) of the sequence then testing is easy).
//so I mean: sum(k=0,10^8,p(k)) and sum(k=0,2*10^8,p(k))
Last edited by harryh on Sun Mar 29, 2009 6:19 pm, edited 2 times in total.
Reason: Added note at the beginning.
Reason: Added note at the beginning.
-
quilan
- Posts: 182
- Joined: Fri Aug 03, 2007 11:08 pm
Re: Problem 238
I'm still working through this one (looked crazy challenging, so I couldn't resist). Once I've got my fast code developed a bit more, I'll see if I can't corroborate this.
ex ~100%'er... until the gf came along.


-
Eigenray
- Posts: 62
- Joined: Mon Jul 14, 2008 5:20 pm
Re: Problem 238
Can you confirm: sum(k=0,10^8,p(k)) = 49...33, sum(0,2*10^8,p(k)) = 99...00?
I am inclined to agree there is something wrong.
I am inclined to agree there is something wrong.
Last edited by Eigenray on Fri Mar 27, 2009 3:43 pm, edited 1 time in total.
-
Robert_Gerbicz
- Posts: 26
- Joined: Sat Oct 13, 2007 2:44 pm
-
harryh
- Posts: 2091
- Joined: Tue Aug 22, 2006 9:33 pm
- Location: Thessaloniki, Greece
Re: Problem 238
Well, it seems that at least one user got it right
To be sure, I've double-checked the answer entered in the database and it is the same as the one we found while developing the problem, so...
To be sure, I've double-checked the answer entered in the database and it is the same as the one we found while developing the problem, so...
-
gonzolino
- Posts: 17
- Joined: Thu Mar 12, 2009 4:17 pm
- Location: Lyon, France
- Contact:
-
Robert_Gerbicz
- Posts: 26
- Joined: Sat Oct 13, 2007 2:44 pm
Re: Problem 238
Or he/she found the same wrong way. Could you confirm the leading/trailing two digits for N=10^8 and for N=2*10^8 (posted above), if you have got a program... I've checked that my slow brute force and fast code gives the answers for N=k*10^6, where k=100..300, yes 201 big values, and there was no difference.harryh wrote:Well, it seems that at least one user got it right![]()
To be sure, I've double-checked the answer entered in the database and it is the same as the one we found while developing the problem, so...
-
gonzolino
- Posts: 17
- Joined: Thu Mar 12, 2009 4:17 pm
- Location: Lyon, France
- Contact:
Re: Problem 238
I think Robert is right. And by the way, choosing n>10^8 is a good idea. Actually, chosing n>=80...91 is meaningful, hu ?
-
harryh
- Posts: 2091
- Joined: Tue Aug 22, 2006 9:33 pm
- Location: Thessaloniki, Greece
Re: Problem 238
Considering that there is only one solution so far, it is possible that we overlooked something.
So, we are temporarily putting it on hold and a new e-mail notification will be sent a few hours before it becomes available again.
Our sincere apologies for the inconvenience.
So, we are temporarily putting it on hold and a new e-mail notification will be sent a few hours before it becomes available again.
Our sincere apologies for the inconvenience.
-
mastro
- Posts: 5
- Joined: Fri Mar 27, 2009 6:35 pm
Re: Problem 238
I'm the one who solved the problem. I hope the problem (and my solution) is correct...
-
JohnMorris
- Posts: 64
- Joined: Sun Dec 23, 2007 6:38 am
-
JohnMorris
- Posts: 64
- Joined: Sun Dec 23, 2007 6:38 am
Re: Problem 238
Now that we all have our code ready, there's going to quite a rush of submissions when it comes backharryh wrote:So, we are temporarily putting it on hold and a new e-mail notification will be sent a few hours before it becomes available again.

-
mastro
- Posts: 5
- Joined: Fri Mar 27, 2009 6:35 pm
Re: Problem 238
As I said, I'm the one that first "solved" the problem and if I apply my fast algorithm to 10^8 and 2*10^8 i get two different values. The only way to get the same number is if all p(k) in that range are zero, which seems impossible given that w is a string of infinite length!Robert_Gerbicz wrote:My semi brute force code gives the same answers for N=10^8 and N=2*10^8
-
quilan
- Posts: 182
- Joined: Fri Aug 03, 2007 11:08 pm
Re: Problem 238
Interpreting what he said, he meant that the brute force & fast solutions agree for both k's. Not that they're the same value.mastro wrote:As I said, I'm the one that first "solved" the problem and if I apply my fast algorithm to 10^8 and 2*10^8 i get two different values. The only way to get the same number is if all p(k) in that range are zero, which seems impossible given that w is a string of infinite length!Robert_Gerbicz wrote:My semi brute force code gives the same answers for N=10^8 and N=2*10^8
ex ~100%'er... until the gf came along.


-
fra
- Posts: 1
- Joined: Mon Nov 10, 2008 1:57 pm
-
BjornEdstrom
- Posts: 37
- Joined: Thu Nov 08, 2007 11:16 pm
-
mastro
- Posts: 5
- Joined: Fri Mar 27, 2009 6:35 pm
Re: Problem 238
Oops, sorry. You're right of course. Still my result for 10^8 is not the 49...33 mentioned by Eigenray and the one for 2*10^8 is not 99...00.quilan wrote:Interpreting what he said, he meant that the brute force & fast solutions agree for both k's. Not that they're the same value.
I'm either a genius or an extremely lucky idiot!
-
JohnMorris
- Posts: 64
- Joined: Sun Dec 23, 2007 6:38 am
Re: Problem 238
Out of curiosity (and to check a wild surmise), what does your algorithm give for the first and last two digits for these?mastro wrote:As I said, I'm the one that first "solved" the problem and if I apply my fast algorithm to 10^8 and 2*10^8 i get two different values.

-
mastro
- Posts: 5
- Joined: Fri Mar 27, 2009 6:35 pm
Re: Problem 238
I get 49...36 and 99...06. I'll try a brute force and see what I get.Thumbo wrote:Out of curiosity (and to check a wild surmise), what does your algorithm give for the first and last two digits for these?
-
JohnMorris
- Posts: 64
- Joined: Sun Dec 23, 2007 6:38 am
Re: Problem 238
Aha! Those match my surmise - I get those answers by including one easy to make error in my code. I'll pm harryh.mastro wrote:I get 49...36 and 99...06. I'll try a brute force and see what I get.Thumbo wrote:Out of curiosity (and to check a wild surmise), what does your algorithm give for the first and last two digits for these?
