*** ( Some number with 3 digits )

** ( Some number with 2 digits )

x

-------------

****

****

-----------

*****

where all the asterisks are prime digits either: 2,3,5 or 7

Ideas, approaches, or even code mayde?

Printable View

- 12-23-2011, 09:25 PMfatabassHow would you solve this? Java coding for multiplication.
*** ( Some number with 3 digits )

** ( Some number with 2 digits )

x

-------------

****

****

-----------

*****

where all the asterisks are prime digits either: 2,3,5 or 7

Ideas, approaches, or even code mayde? - 12-23-2011, 09:39 PMJosAHRe: How would you solve this? Java coding for multiplication.
It cannot be solved because the righrmost digit in the fourth row has to be a zero.

kind regards,

Jos - 12-23-2011, 09:41 PMfatabassRe: How would you solve this? Java coding for multiplication.
What makes you think that?

I am sure it is a "can be solved" question. - 12-23-2011, 09:59 PMpbrockway2Re: How would you solve this? Java coding for multiplication.
- 12-23-2011, 10:02 PMfatabassRe: How would you solve this? Java coding for multiplication.
- 12-23-2011, 10:08 PMJosAHRe: How would you solve this? Java coding for multiplication.
The last digit of the top two numbers have to be a 3 and a 5 (...3x..5 = ....5 (or ..5x.3 = ....5 is the only possibility), so the last digit of the result is 5 as well. Maybe consistent reasoning like this can help you to solve this puzzle. If there are too many alternatives I'd take the lazy approach (brute force)

kind regards,

Jos - 12-23-2011, 10:11 PMfatabassRe: How would you solve this? Java coding for multiplication.
I am trying to solve it with Java :)

Thanks though... :)

I have this idea of looping for all numbers in the first 2 rows and multiplying them and to check if they are all prime numbers(2,3,5,7)..

But can there be a better approach ? - 12-23-2011, 10:15 PMpbrockway2Re: How would you solve this? Java coding for multiplication.
Totally slow answer adding nothing removed.

@OP: That's more or less what I would do. - 12-23-2011, 10:30 PMJosAHRe: How would you solve this? Java coding for multiplication.
There are four different digits (2, 3, 5 and 7) so you should count in base 4. There are 4x4x4 possible first numbers and 4x4 possible second numbers. You can try them all after mapping 0 --> 2, 1 --> 3, 2 --> 5 and 3 --> 7 and see which numbers have the correct result.

kind regards,

Jos - 12-23-2011, 10:34 PMfatabassRe: How would you solve this? Java coding for multiplication.
Thank you