Call a positive integer totally odd if all of its decimal digits are odd.
Show that for any positive integer k there is a k-digit totally odd integer which is a multiple of 5k.
*** Adapted from a problem which appeared at the USA Mathematical Olympiad in 2003.
There's a definite pattern to the products:
exponent
of 5 power multiplier product
1 5 1 5
2 25 3 75
3 125 3 375
4 625 15 9375
5 3125 19 59375
6 15625 23 359375
7 78125 43 3359375
8 390625 239 93359375
9 1953125 99 193359375
10 9765625 327 3193359375
11 48828125 1499 73193359375
12 244140625 3167 773193359375
13 1220703125 3091 3773193359375
14 6103515625 12087 73773193359375
15 30517578125 25355 773773193359375
16 152587890625 37839 5773773193359375
After k=16 the switch to scientific notation caused by the limits of double-precision floating point resulted in an endless loop:
for k=1:21
p=5^k ;
lowMult=ceil(10^(k-1)/p);
for mult=lowMult:lowMult*10
ns=num2str(mult*p);
if isempty(setdiff(ns,'13579'))
fprintf('%2d %16d %5d %16d\n',k,p,mult,mult*p)
break
end
end
end
|
Posted by Charlie
on 2024-10-06 09:04:59 |