Problem 396

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
OskarS
Posts: 6
Joined: Tue Nov 01, 2011 11:17 pm

Problem 396

Post by OskarS »

I saw that a previous thread on this problem had been locked, but I actually need something about this problem clarified, so I figured I'd start a new thread. If this is inappropriate, I apologize, and feel free to delete or lock this one too.

I keep getting an off-by-one error when calculating the length of the sequence and comparing it to the examples in the problem description. For instance, for G(2) the page says that the length is 3, but the way I calculate it, the sequence is {2,2,1,0}, with a length of 4. Similarly, I get 22 for G(4) and 382 for G(6).

This would be simple enough to correct (just subtract 1!), but I'm concerned that I might not be getting some part of the problem. Does the final 0 not count in the sequence, so that the sequence for G(2) is {2,2,1}, not {2,2,1,0}? That would be the most obvious answer, I guess. I have some ideas about how to solve it, but I really would like this clarified first.

Thanks!
User avatar
Marcus_Andrews
Administrator
Posts: 1637
Joined: Wed Nov 09, 2011 5:23 pm

Re: Problem 396

Post by Marcus_Andrews »

From the problem statement:
Let G(n) be the number of nonzero elements in the nth weak Goodstein sequence.
In other words, the list underlying G(2) would be {2, 2, 1}.
OskarS
Posts: 6
Joined: Tue Nov 01, 2011 11:17 pm

Re: Problem 396

Post by OskarS »

Ahh, I see. I don't know how I missed that. Thanks!
User avatar
kenbrooker
Posts: 187
Joined: Mon Feb 19, 2018 3:05 am
Location: Northern California, USA

Re: Problem 396

Post by kenbrooker »

Problem reads:

It can also be verified that SumG(n) = 2517 for 1 <= n <= 8.

I think intended is:

It can also be verified that SumG(n) = 2517 for 1 <= n <= 7.

How I wished that the implied
G(8) was as simple as zero. :(
"Good Judgment comes from Experience;
Experience comes from Bad Judgment
..."
Image
v6ph1
Posts: 134
Joined: Mon Aug 25, 2014 7:14 pm

Re: Problem 396

Post by v6ph1 »

Read carefully:
It can also be verified that SumG(n) = 2517 for 1 <= n < 8.
The second one is just a less not a less-equal
Image
User avatar
kenbrooker
Posts: 187
Joined: Mon Feb 19, 2018 3:05 am
Location: Northern California, USA

Re: Problem 396

Post by kenbrooker »

Sorry and Thanks Much...

When I copy and paste <= into my Java programs they are changed to < and
I have to correct them to <= and
I over-corrected!
"Good Judgment comes from Experience;
Experience comes from Bad Judgment
..."
Image
Post Reply