## Problem 008

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

Don't post any spoilers
vulcant
Posts: 2
Joined: Thu Aug 25, 2011 12:05 am

### Re: Problem 008

Ah sorry about that. I'm using c++ currently.

pawanbcd
Posts: 3
Joined: Sun Jun 10, 2012 11:10 am

### Problem 08

Hello All,

I am not able to understand problem number 8.

My Understanding:

1) trying to find the 5 consecutive number (having the highest product) within this 1000 digit numbers.
2) say, i select (1-5) numbers, get it's product, then get(2-6) number and get it's product.... keep doing this thing till the end and always making a note of the highest number within them.

Am I right?

1) I just loop through the 1000 digits.
2) Get the 5 numbers from the array 1 by 1.
3) Get the product of the these number.
4) Compare the previous highest value with the present one .
....

EdoI
Posts: 1
Joined: Sun Jun 10, 2012 6:22 pm

### Re: Problem 08

Well, have you tried that way? What result did you get?

Usuario
Posts: 2
Joined: Mon May 28, 2012 5:12 am
Location: Argentina

### Re: Problem 08

The answer is the product, not the 5 digit string

Ex: If you get that the string 12345 with product 120 has the greatest product, then the answer is 120 and NOT 12345

rayfil
Posts: 1401
Joined: Sun Mar 26, 2006 4:30 am
Contact:

### Re: Problem 008

@pawanbcd

We realize you are new to this forum. For problems under 100, the number is padded with leading 0's to make it a 3-digit number. This makes it easier for archiving and searching. By using this procedure, an answer to your question might already be available in previous posts.

You may also find useful information in the sticky topic entitled "Comments, questions and clarifications about PE problems".
When you assume something, you risk being wrong half the time.

pawanbcd
Posts: 3
Joined: Sun Jun 10, 2012 11:10 am

### Re: Problem 08

EdoI wrote:Well, have you tried that way? What result did you get?
Yes I tried this way and i get the answer as "28xx68" ( cannot tell the complete as per website rules ).

It says it is wrong answer.

pawanbcd
Posts: 3
Joined: Sun Jun 10, 2012 11:10 am

### Re: Problem 08

Usuario wrote:The answer is the product, not the 5 digit string

Ex: If you get that the string 12345 with product 120 has the greatest product, then the answer is 120 and NOT 12345
Yes i got this point and i copied the product of the consecutive five number as my answer, My Answer is "Edited away by moderator" and the consecutive string i get is "Edited away by moderator"?

It tells the answer is wrong.

TripleM
Posts: 382
Joined: Fri Sep 12, 2008 2:31 am

### Re: Problem 008

You should probably edit out even those figures, since searching for those partial strings really gives everything away.

Have you tried multiplying the digits you found by hand? I can't see how you possibly got the product you mentioned.

jaap
Posts: 540
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

### Re: Problem 008

You do realise that the problem asks for the product of FIVE digits, don't you?

yasar
Posts: 3
Joined: Tue Jul 17, 2012 2:54 pm

### Re: Problem 008

hello all i started this problem a day ago i think my code should do what the problem asks but i keep getting the wrong answer

also guys what is the maximum size u can use an array with i.e

const int MAX = 50;
int array[MAX] ={};

i am asking because does the size alter calculation accuracy because im using a size of 250 to hold the numbers given in the problem.

rockstome
Posts: 17
Joined: Tue Sep 06, 2011 2:54 pm

### Re: Problem 008

Why 250?
How many sets of five consecutive digits have 6-digit number?

yasar
Posts: 3
Joined: Tue Jul 17, 2012 2:54 pm

### Re: Problem 008

i have none that = 6 digit number max is 5.

mega_unknown
Posts: 3
Joined: Sat Aug 25, 2012 9:28 pm

### Problem 08

Dear Geek Friends, I'm new to project euler and I'm so happy to find such a place to tease my mind.
I just want someone to assure my understanding to the problem 08.
The idea behind problem 8 is to divide the whole string into sub-strings (200 Arrays) , each array is 5 consecutive characters from 0-999, then multiply Array's characters after converting each character to integer. Finally find the greatest product...
The Greatest Product is 31752.

TripleM
Posts: 382
Joined: Fri Sep 12, 2008 2:31 am

### Re: Problem 08

There are more than 200 possible 5-digit substrings of a 1000 digit string. 31671 is the second one.

rayfil
Posts: 1401
Joined: Sun Mar 26, 2006 4:30 am
Contact:

### Re: Problem 008

@mega_unknown :

For your info, problem numbers below 100 are padded with two 0's to make them 3-digit numbers.

Also for your info, starting with the first digit of the 1000-digit string having an index of 1, the first 5-digit substring would be digits 1-5; the next 5-digit substring would be digits 2-6; and so on. How many 5-digit substrings would there be in the 1000-digit string???
When you assume something, you risk being wrong half the time.

mega_unknown
Posts: 3
Joined: Sat Aug 25, 2012 9:28 pm

### Re: Problem 008

I feel so stupid through solving this problem...there is no complete explanation for this problem.
I beg the admin to rewrite this problem in humble way...I understood it in many ways and no one is correct.

Code: Select all

{snip}
Last edited by rayfil on Sun Aug 26, 2012 4:59 am, edited 1 time in total.
Reason: No code is allowed in this forum.

rayfil
Posts: 1401
Joined: Sun Mar 26, 2006 4:30 am
Contact:

### Re: Problem 008

@mega_unknown :

Please read again the big red banner at the top of the page when you make a post.

As for your request to rewrite the problem description, it has already been solved by well over 100,000 persons without any such request. It can be assumed that it is sufficiently clear.
When you assume something, you risk being wrong half the time.

mega_unknown
Posts: 3
Joined: Sat Aug 25, 2012 9:28 pm

### Re: Problem 008

Thanks rayfil , I have solved it couple seconds ago

pcworx
Posts: 6
Joined: Wed Nov 27, 2013 3:52 pm

### Re: Problem 008

How did everyone grab the data off the number 008 site? I copied/pasted into idle (python) and I am getting syntax errors in the data also does the same when I grabbed data from source of the page.

Thanks

rayfil
Posts: 1401
Joined: Sun Mar 26, 2006 4:30 am