The 9 spots in a 3×3 grid are filled with distinct digits. Consider the 6 three-digit numbers obtained by reading left to right along rows, or down along columns. All 6 of these numbers are divisible by 6. How many are divisible by 5?
All the 3-digit numbers in such a grid are even in order to be multiples of 6, so to be multiples of 5 they need to end in zero. There's only one zero as the digits are distinct. If the zero is at the bottom-right, there are two multiples of 5; if in the last row or column otherwise, there is one; if no zeros or not in the last row or column, there's no multiple of 5.
All the cases do in fact have exactly one multiple of 5:
There are 48 such grids:
132
570
684
138
570
624
150
372
864
150
378
264
150
972
864
150
978
264
156
372
804
156
378
204
156
972
804
156
978
204
192
570
684
198
570
624
312
750
864
312
756
804
318
750
264
318
756
204
372
150
864
372
156
804
378
150
264
378
156
204
510
732
684
510
738
624
510
792
684
510
798
624
570
132
684
570
138
624
570
192
684
570
198
624
732
510
684
738
510
624
750
312
864
750
318
264
750
912
864
750
918
264
756
312
804
756
318
204
756
912
804
756
918
204
792
510
684
798
510
624
912
750
864
912
756
804
918
750
264
918
756
204
972
150
864
972
156
804
978
150
264
978
156
204
ct =
48
Each of them has a zero in the last row or column, but not in the lower right corner, so there is exactly 1 3-digit number that's divisible by 5.
clearvars,clc
list=char.empty(0,3);
ct=0
for i=17:166
ns=num2str(6*i);
if length(ns)==length(unique(ns))
list(end+1,:)=ns;
end
end
for a=1:length(list)
r1=list(a,:);
for b=1:length(list)
r2=list(b,:);
tst=[r1 r2];
if length(tst)==length(unique(tst))
for c=1:length(list)
r3=list(c,:);
tst=[r1 r2 r3];
g=[r1; r2; r3];
n1=str2double(g(1:3,1));
n2=str2double(g(1:3,2));
n3=str2double(g(1:3,3));
if mod(n1,6)==0
if mod(n2,6)==0
if mod(n3,6)==0
if length(tst)==length(unique(tst))
% if length(find(g=='0'))==0
disp([r1; r2; r3])
disp(' ')
ct=ct+1;
% end
end
end
end
end
end
end
end
end
ct
|
Posted by Charlie
on 2025-01-19 10:04:31 |