Problem 038
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.
Re: Problem 038
I still must be misunderstanding something. The solution is supposed to be the largest number, nine digits, permutation of 1..9, right? The largest number I get that meets all of the requirements given is given as one of the examples, and is not accepted as the right answer. I can generate 4 other candidates, each from a 3 digit number multiplied by (1, 2, 3). The two examples given are the highest and lowest numbers that I can generate, so I have 3 others.
What am I missing?
What am I missing?
Re: Problem 038
Hi spen,
It appears to me that you understand the problem correctly, but have overlooked some candidates in your analysis. I do not know how many concatenated pandigital products with three, threedigit numbers there are as those never really caught my interest in the problem.
Slaunger
It appears to me that you understand the problem correctly, but have overlooked some candidates in your analysis. I do not know how many concatenated pandigital products with three, threedigit numbers there are as those never really caught my interest in the problem.
Slaunger
Re: Problem 038
People are talking about reverse order here (n,...,3,2,1), but as far as I understand the problem, we are looking for the closest to 999999999 number that can be formed as the concatenated product of an integer and one of the lists:
(1,2)
(1,2,3)
(1,2,3,4)
.............
(1,2,3,4,...,n)
Am I right?
(1,2)
(1,2,3)
(1,2,3,4)
.............
(1,2,3,4,...,n)
Am I right?
Re: Problem 038
Yes. The problem used to be worded differently, thus the confusion in the earlier posts.
Re: Problem 038
I don't want to give away anything, but I have to tell you that I loved working on this one! At first I got sidetracked taking something for granted that I shouldn't have, and I got one of the pandigitals in the example, which of course wasn't the answer. Realising my supposition was wrong made me come up with better, more flexible code and also made me aware that I was overlooking some cases that I really shouldn't have. This time I loved being wrong. Cheers!
Re: Problem 038
I believe the title is misspelled. I think it should be "multiple".
Re: Problem 038
Thanks, changed.
Re: Problem 038
I am completely stuck on this. I can't for the life of me see why the second example is not the right answer  and my program agrees with me! Does anyone feel like giving me a slight hint?
Re: Problem 038
The number of concatenated products can be anywhere from 2 to 9. Don't get in a rut thinking that they must all be the same number of digits.dunne wrote:I am completely stuck on this. I can't for the life of me see why the second example is not the right answer  and my program agrees with me! Does anyone feel like giving me a slight hint?
Re: Problem 038
Thanks, thundre. I am sure I have avoided this problem. Here's what I am doing (hopefully not giving away too much  I doubt it, since my method is clearly flawed!) :thundre wrote:The number of concatenated products can be anywhere from 2 to 9. Don't get in a rut thinking that they must all be the same number of digits.dunne wrote:I am completely stuck on this. I can't for the life of me see why the second example is not the right answer  and my program agrees with me! Does anyone feel like giving me a slight hint?
I am taking from 1 to 4 (although I think 3 is the actual limit) of the most signficant digits in turn from each pandigital, and generating and concatenating the products one by one, using 1,2,3...9. I don't bother about the number of products or the number of digits in each product. I have a check that stops this generation/concatenation as soon as the pandigital is reached or exceeded. I am doing this for *all* pandigitals, starting with the biggest. I get valid results, but the highest is always the second example from the problem text.
Re: Problem 038
So you're checking all 9! pandigitals, or at least the ~8! which are greater than 918273645.dunne wrote: I am taking from 1 to 4 (although I think 3 is the actual limit) of the most signficant digits in turn from each pandigital, and generating and concatenating the products one by one, using 1,2,3...9. I don't bother about the number of products or the number of digits in each product. I have a check that stops this generation/concatenation as soon as the pandigital is reached or exceeded. I am doing this for *all* pandigitals, starting with the biggest. I get valid results, but the highest is always the second example from the problem text.
If instead of a pandigital you give it 666613332, does it acknowledge that it's 6666 * (1,2)?
Re: Problem 038
I am *generating* all 9!, but since I sort before checking and start checking at the end of the array, I stop at the first one found, which by definition is the biggest.thundre wrote: So you're checking all 9! pandigitals, or at least the ~8! which are greater than 918273645.
If instead of a pandigital you give it 666613332, does it acknowledge that it's 6666 * (1,2)?
I gave it that number, it *didn't* acknowledge it, and almost at once I knew exactly why! Thanks a lot thundre, just a simple coding error but without talking it through with someone I doubt I would have spotted it any time soon.

 Posts: 1
 Joined: Mon Apr 30, 2018 7:26 am
Problem 038
When I read through this problem, I didn't realize what "1 to 9 pandigital" meant until I submitted the wrong answer a few times. My impression was that "1 to 9 pandigital" meant a number with 9 digits that was created through that multiplication form. I would recommend revising the text to define pandigital. For example:Take the number 192 and multiply it by each of 1, 2, and 3:
[..]
By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the concatenated product of 192 and (1,2,3)
By concatenating each product we get the 1 to 9 pandigital (a number that contains all the digits 19), 192384576...
Re: Problem 038
Please don't start a new topic for a problem if there exists one already.
Re: Problem 038
sorry couldn't find the other post so I'm asking here:
I probably don't get something regarding pandigitals since I had the same problem at 032.
I get a better answer that only the 2nd best is being accepted.
So maybe can someone explain me what's bad with 2469 *4 and 2469 *5 ?
I probably don't get something regarding pandigitals since I had the same problem at 032.
I get a better answer that only the 2nd best is being accepted.
So maybe can someone explain me what's bad with 2469 *4 and 2469 *5 ?
Re: Problem 038
If you want to go up to 5 you have to concatenate 2469*1 and 2469*2 and 2469*3 and 2469*4 and 2469*5.
This gives 246949387407987612345
This gives 246949387407987612345