Pandigital Products
Problem 32
We shall say that a n-digit number is pandigital if it makes use of the 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, 39x186 = 7254, containing multiplicand, multiplier, and product is 1 Throu GH 9 pandigital.
Find the sum of whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital.
Hint:some products can is obtained in more than one-to-one-to-so is sure to only include it once in your sum.
Answer:
45228
Completed on Sat, Jul 2015, 15:13
Python code:
fromMathImportsqrt def func(x):S0=set (str (x)) forIinchRange2, Min ( -, int (sqrt (x) +1))):ifx%i==0: S1=set (str (i)) S2=set (str (x//i)) s=s0|s1|s2ifLen (s) = =9 and ' 0 ' not inchSreturn True return Falseresult=0 forIinchRange +,9999): Pstr=str (i)ifLen (Set (Pstr)) = =4 and ' 0 ' not inchPSTR:ifFunc (i): Result+=i print (i) print (result)
Because the requirements of the product can not be repeated, it is possible to consider the product candidate cycle judgment, the addition of satisfying conditions, and it is easy to disprove the proof that the product number of digits can only be 4.
The number 1-9 is an interesting question, and more questions can be referred to
Http://www.worldofnumbers.com/ninedig1.htm
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Eularproject 32: Number 1-9 permutations constitute multiplication equation