Let n be an integer greater than 1.
If all digits of 1996*n are even, then find the smallest possible value of n.
The smallest value for n is 333.
333 * 1996 = 664668
If there were the additional constraint that n be composed of only evens then:
444 * 1996 = 886224
-----------
odds = '13579'
for n in range(1,10000000):
s = str(1996*n)
fail = False
for digit in odds:
if digit in s:
fail = True
break
if fail:
continue
print(n,1996*n)
break
|
Posted by Larry
on 2024-10-30 09:59:24 |