Page 1 of 1

Problem 301

Posted: Tue Jul 19, 2016 10:32 pm
by enigmaticcam
I have an algorithm that gets me an answer that is not correct, but I feel like it should be. Can someone confirm if they get the same results where n <= 2^x?

Code: Select all

f(1) = 1
f(2) = 1
f(3) = 3
f(4) = 8
f(5) = 18
f(6) = 39
f(7) = 81
f(8) = 166
f(9) = 336
f(10) = 677

Re: Problem 301

Posted: Tue Jul 19, 2016 11:11 pm
by v6ph1
They are all wrong.

n<=2^0: 1
n<=2^1: 2

Re: Problem 301

Posted: Tue Jul 19, 2016 11:49 pm
by enigmaticcam
v6ph1 wrote:They are all wrong.

n<=2^0: 1
n<=2^1: 2
Realized I was checking for wins and not losses. Either way though, I had to change it completely. I have it now, thank you!

Re: Problem 301

Posted: Sun Jun 24, 2018 11:42 pm
by kenbrooker
Reluctant to ask because I must be making another careless error again but, as documented on PE.net, myself and
at least one other solver can only get the correct solution by [myself accidentally and the other(s) intentionally]
including {0,0,0} as a valid losing triplet.
Any thoughts most appreciated.

Re: Problem 301

Posted: Mon Jun 25, 2018 8:29 am
by RobertStanforth
I'm happy to clarify that {0,0,0} is indeed a losing triplet. The player is "unable to move (because no stones remain)".

Re: Problem 301

Posted: Mon Jun 25, 2018 8:57 am
by dtsarun
Hi thanks for the clarification.

But the confusion arose because {0,0,0} is a solution for n=0, but the question asked for positive integers of n.

Re: Problem 301

Posted: Mon Jun 25, 2018 9:36 am
by RobertStanforth
Ah, I see. Nevertheless, the question is correct as stated.
{0, 0, 0} is a losing triple, but it does not count towards the answer.
If people need to count it to get the correct answer, it is likely they have an off-by-one error elsewhere.

Re: Problem 301

Posted: Mon Jun 25, 2018 6:15 pm
by kenbrooker
Just to express my appreciation and to let you and jaap and dtsarun know that
I have just now added another Post on the Subject at PE.net which,
I'm afraid, only adds to the mystery...

Re: Problem 301

Posted: Mon Jun 25, 2018 7:55 pm
by hk
Ken, I posted a possible source of the problem in the forum.

Re: Problem 301

Posted: Mon Jun 25, 2018 9:15 pm
by kenbrooker
Thanks! hk et al,

I thought we might need yet one more Dutchman but, by my latest Post at PE.net,
I think we can put this mystery to rest, semi-solved...