+--+--+--+
|2 | 6| 4|
+--+--+--+
|2 | 0| 0|
+--+--+--+
The 2x3 grid given above has an interesting property: If you read horizontally, you get 264 and 200, where 264×200 = 52800. If you read vertically, you get 22, 60 and 40, where 22×60×40 = 52800.
So the horizontal product is the same as the vertical product. Find a 2×4 grid with the same property using 8 different digits.
clearvars,clc
for a=123:9999
top=sprintf('%04d',a);
if isequal(top(3:4),'00') % for progress indication only
disp(top)
end
for b=123:9999
p=a*b;
bot=sprintf('%04d',b);
p2=prod(10*(top-'0')+bot-'0');
if p==p2
disp(' ')
disp(top)
disp(bot)
disp(' ')
end
end
end
finds the following sets that meet the multiplication criterion, but have not been checked for repeated digits.
1395
1100
1485
1584
1584
1485
1595
1800
1680
0248
1694
1680
1768
2835
1768
2880
2288
1680
2368
1743
2376
1323
2496
2365
2646
1323
2646
1350
2736
1281
2755
1680
2765
1950
2793
1680
2835
1024
2835
1155
3660
0124
3660
0165
3660
0217
3795
3024
3828
1798
4389
2880
4464
1025
4725
0704
5475
1530
5499
3710
5568
2860
5600
5700
5767
3339
6696
3220
6700
6800
6885
3150
6889
6336
7560
0299
7896
4440
9568
2950
9840
0288
Only one does not repeat any digit:
2793
1680
2793 * 1680 = 4692240
21 * 76 * 98 * 30 = 4692240
|
Posted by Charlie
on 2023-10-04 09:14:50 |