Problem32

We shall say that an n-digit number is pandigital if it makes use of  all the digits 1 to n exactly once; for example, the 5-digit number,  15234, is 1 through 5 pandigital.

 The product 7254 is unusual, as the identity, 39*186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.

 Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital.

HINT: Some products can be obtained in more than one way
so be sure to only include it once in your sum.

* 根據題意分析:
* 因爲A*B=C,而且A、B不能等於1,所以C>B,C>A。
* A的位數+B的位數+C的位數=9,所以C大於3位,C>=1000。
* A的位數+B的位數=9-C的位數,若C爲4位,則有兩種組合(A爲1位,B爲4位;A爲2位,B爲3位)可以滿足。
* 若C爲5位,則A的位數+B的位數=4,不可能滿足A*B=C的條件。
*
* 所以C的範圍爲(1000-9999)
* A/B的範圍爲(2-4999),因爲A、B位置可互換,
* 所以A的取值範圍可確定(2-99),B的取值範圍(100-4999)

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章