Problem 301

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
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.

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


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Post Reply
enigmaticcam
Posts: 16
Joined: Wed Sep 30, 2015 12:07 am

Problem 301

Post 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
v6ph1
Posts: 134
Joined: Mon Aug 25, 2014 7:14 pm

Re: Problem 301

Post by v6ph1 »

They are all wrong.

n<=2^0: 1
n<=2^1: 2
Image
enigmaticcam
Posts: 16
Joined: Wed Sep 30, 2015 12:07 am

Re: Problem 301

Post 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!
User avatar
kenbrooker
Posts: 187
Joined: Mon Feb 19, 2018 3:05 am
Location: Northern California, USA

Re: Problem 301

Post 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.
Last edited by kenbrooker on Mon Jun 25, 2018 6:20 pm, edited 1 time in total.
"Good Judgment comes from Experience;
Experience comes from Bad Judgment
..."
Image
User avatar
RobertStanforth
Administrator
Posts: 2666
Joined: Mon Dec 30, 2013 11:25 pm

Re: Problem 301

Post 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)".
dtsarun
Posts: 1
Joined: Mon Jun 25, 2018 8:49 am

Re: Problem 301

Post 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.
Last edited by dtsarun on Tue Jun 26, 2018 3:07 pm, edited 1 time in total.
User avatar
RobertStanforth
Administrator
Posts: 2666
Joined: Mon Dec 30, 2013 11:25 pm

Re: Problem 301

Post 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.
User avatar
kenbrooker
Posts: 187
Joined: Mon Feb 19, 2018 3:05 am
Location: Northern California, USA

Re: Problem 301

Post 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...
"Good Judgment comes from Experience;
Experience comes from Bad Judgment
..."
Image
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 301

Post by hk »

Ken, I posted a possible source of the problem in the forum.
Image
War ruins the life and health of untold numbers of innocent children.
User avatar
kenbrooker
Posts: 187
Joined: Mon Feb 19, 2018 3:05 am
Location: Northern California, USA

Re: Problem 301

Post 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...
"Good Judgment comes from Experience;
Experience comes from Bad Judgment
..."
Image
Post Reply