Problem 308

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
kingvash
Posts: 13
Joined: Sun Nov 22, 2009 2:57 am

Problem 308

Post by kingvash »

I am having difficulty counting the number of iterations (it may be just a fence post problem).

Could anyone confirm that it takes takes:
19 iterations to produce 2 ^ 2
36980 iterations to produce 2 ^ 29
73886466 iterations to produce 2 ^ 379

Thanks.

sivakd
Posts: 217
Joined: Fri Jul 17, 2009 8:37 am
Location: California, USA
Contact:

Re: Problem 308

Post by sivakd »

I haven't solved it yet. I have a basic algorithm that can generate the primes but it would take a lot of time to find the answer being asked. In your case, the first one is correct. But the remaining two are off by 1.

Edit: I can now confirm my above statement after solving this problem.
Image
puzzle is a euphemism for lack of clarity

dstrower
Posts: 4
Joined: Thu Jan 20, 2011 2:09 pm
Location: USA (Little Rock Arkansas )

Re: Problem 308

Post by dstrower »

Did you have any difficulty in getting the program to run in under a minute?
Image

raggie
Posts: 4
Joined: Tue Dec 28, 2010 9:55 pm

Re: Problem 308

Post by raggie »

Is an unsigned 32 (or 64) bit integer enough to store the answer?

User avatar
hk
Administrator
Posts: 10697
Joined: Sun Mar 26, 2006 9:34 am
Location: Haren, Netherlands

Re: Problem 308

Post by hk »

32: no. 64: yes.
Image

User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 308

Post by Oliver1978 »

There seem to exist two valid versions. Version A takes 707 steps to find 2^7, Version B takes 710 steps.

On which of those does the correct solution rely?
49.157.5694.1125

User avatar
kenbrooker
Posts: 140
Joined: Mon Feb 19, 2018 3:05 am
Location: Northern California, USA

Re: Problem 308

Post by kenbrooker »

I vote for 710...
"Good Judgment comes from Experience;
Experience comes from Bad Judgment
..."
Image

User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 308

Post by Oliver1978 »

Is that vote because you've already solved this? Or just a guess...
49.157.5694.1125

User avatar
kenbrooker
Posts: 140
Joined: Mon Feb 19, 2018 3:05 am
Location: Northern California, USA

Re: Problem 308

Post by kenbrooker »

Solved, but you never know...
"Good Judgment comes from Experience;
Experience comes from Bad Judgment
..."
Image

User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 308

Post by Oliver1978 »

Apparently it's the slow branch then. Thanks :)
49.157.5694.1125

Post Reply