Problem 321
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.
-
LarryBlake
- Posts: 100
- Joined: Sat Aug 29, 2009 8:49 pm
- GenePeer
- Posts: 112
- Joined: Sat Apr 03, 2010 1:14 pm
- Contact:
Re: Problem 321
Whichever the case, I doubt it would provide the optimal solution.
This is the first "new" problem I have tried, as I prefer solving sequentially. I'm currently at 103. I've found a formula for the number of moves needed, and was able to generate the first 22 terms. It could take days if I continued like this. Can someone hint me in the right direction?
This is the first "new" problem I have tried, as I prefer solving sequentially. I'm currently at 103. I've found a formula for the number of moves needed, and was able to generate the first 22 terms. It could take days if I continued like this. Can someone hint me in the right direction?

- stijn263
- Posts: 1505
- Joined: Sat Sep 15, 2007 11:57 pm
- Location: Netherlands
- GenePeer
- Posts: 112
- Joined: Sat Apr 03, 2010 1:14 pm
- Contact:
Re: Problem 321
Why did I think there's no possible pattern? Thank you, I just had my first post in an unarchived thread.

-
sivakd
- Posts: 217
- Joined: Fri Jul 17, 2009 9:37 am
- Location: California, USA
- Contact:
Re: Problem 321
GenePeer, congratulations. I just noticed that you are the only person from your country. So, a good achievement indeed.
GenePeer wrote:Why did I think there's no possible pattern? Thank you, I just had my first post in an unarchived thread.

puzzle is a euphemism for lack of clarity
-
john.schooling
- Posts: 1
- Joined: Sun Jan 09, 2011 6:37 pm
Re: Problem 321
I get 5=99, 10=8108, 20=54608372. Can anyone confirm this is correct please. My answer to 40 terms is incorrect. I may have a rounding or overflow problem.
Thanks.
Thanks.
- jaap
- Posts: 588
- Joined: Tue Mar 25, 2008 3:57 pm
- Contact:
-
gotclout
- Posts: 1
- Joined: Mon Mar 14, 2011 11:32 pm
Re: Problem 321
I'm having a similar issue, however I'm making a first attempt to solve this in python and I'm not sure if the problem could be rounding or overflow.john.schooling wrote:I get 5=99, 10=8108, 20=54608372. Can anyone confirm this is correct please. My answer to 40 terms is incorrect. I may have a rounding or overflow problem.
Thanks.
-
ingreenheaven
- Posts: 4
- Joined: Wed Apr 20, 2011 6:50 am
Re: Problem 321
I can't see the patternGenePeer wrote:Why did I think there's no possible pattern? Thank you, I just had my first post in an unarchived thread.
-
ingreenheaven
- Posts: 4
- Joined: Wed Apr 20, 2011 6:50 am
Re: Problem 321
My answer for 20 matches with the answers above, but my final answer is not correct. Can somebody verify if these values are correct. 25: 636562052 and 30: 1583407950?
Also any push in the right direction for identifying the pattern will be very helpful.
Also any push in the right direction for identifying the pattern will be very helpful.
- jaap
- Posts: 588
- Joined: Tue Mar 25, 2008 3:57 pm
- Contact:
Re: Problem 321
No. You probably have a 32 bit integer overflow problem. You need 64 bit integers.ingreenheaven wrote:My answer for 20 matches with the answers above, but my final answer is not correct. Can somebody verify if these values are correct. 25: 636562052 and 30: 1583407950?
-
ingreenheaven
- Posts: 4
- Joined: Wed Apr 20, 2011 6:50 am
Re: Problem 321
Thank you.jaap wrote:No. You probably have a 32 bit integer overflow problem. You need 64 bit integers.ingreenheaven wrote:My answer for 20 matches with the answers above, but my final answer is not correct. Can somebody verify if these values are correct. 25: 636562052 and 30: 1583407950?
-
ingreenheaven
- Posts: 4
- Joined: Wed Apr 20, 2011 6:50 am
Re: Problem 321
Done. It was a problem with precision. The pattern that I thought was there didn't work because of precision error and so I thought I was missing something. Thanks for your help.
-
DeEiserne
- Posts: 2
- Joined: Wed Dec 17, 2014 11:14 pm
Re: Problem 321
There's something I don't quite understand:
If we take n=2, then we have 2 red, 2 blue counters. Let's just write the configuration as 1 2 3 4 5 , where 1 and 2 are initially occupied by the 2 red counters, etc. For n=2, there is a solution with 8 actions:
2 -> 3
4 -> 2
5 -> 4
3 -> 5
1 -> 3
2 -> 1
4 -> 2
3 -> 4
M(1) is clearly 3 and M(3) is clearly 15, so according to the problem's description, M(2) should be 10. But M(2) is 8 (see above) and 8 is clearly not a triangle number.
What am I doing wrong?
If we take n=2, then we have 2 red, 2 blue counters. Let's just write the configuration as 1 2 3 4 5 , where 1 and 2 are initially occupied by the 2 red counters, etc. For n=2, there is a solution with 8 actions:
2 -> 3
4 -> 2
5 -> 4
3 -> 5
1 -> 3
2 -> 1
4 -> 2
3 -> 4
M(1) is clearly 3 and M(3) is clearly 15, so according to the problem's description, M(2) should be 10. But M(2) is 8 (see above) and 8 is clearly not a triangle number.
What am I doing wrong?
- mpiotte
- Administrator
- Posts: 1961
- Joined: Tue May 08, 2012 5:40 pm
- Location: Montréal, Canada
Re: Problem 321
You misread the question. Nowhere is the value of M(2) provided. The problem statement gives that M(3) = 15 and that M(1), M(3), M(10), M(22) and M(63) are triangular numbers (without giving the value).DeEiserne wrote:There's something I don't quite understand:
If we take n=2, then we have 2 red, 2 blue counters. Let's just write the configuration as 1 2 3 4 5 , where 1 and 2 are initially occupied by the 2 red counters, etc. For n=2, there is a solution with 8 actions:
2 -> 3
4 -> 2
5 -> 4
3 -> 5
1 -> 3
2 -> 1
4 -> 2
3 -> 4
M(1) is clearly 3 and M(3) is clearly 15, so according to the problem's description, M(2) should be 10. But M(2) is 8 (see above) and 8 is clearly not a triangle number.
What am I doing wrong?

-
DeEiserne
- Posts: 2
- Joined: Wed Dec 17, 2014 11:14 pm
- Jochen_P
- Posts: 55
- Joined: Mon Oct 05, 2009 10:47 am
- Location: Stuttgart, Germany
Re: Problem 321
hmm ... pattern spotting ... 1,3,10,22,63,1nn,3nnstijn263 wrote: Sun Jan 23, 2011 6:04 pm Can you perhaps spot a pattern among those first 22 terms?
Have fun solving!
Nope, don't see any. Any hint?
Got the same results as others for 20(correct), 25(false) and 30(false)

- Jochen_P
- Posts: 55
- Joined: Mon Oct 05, 2009 10:47 am
- Location: Stuttgart, Germany

