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)

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值