α, β, γ, δ, ε, ζ represents 6 consecutive digits (in any order) of base-N, where N is a positive integer.
It is known that:
(αβ)2 + (γδ)2 = (εζ)2
Determine the minimum value of N.
Note: αβ represents the concatenation of the digits and not their multiplication.
clearvars,clc
for bs=6:33
allDigs=[0:bs-1];
for st=1:length(allDigs)-6+1
digs=allDigs(st:st+5);
setOfDigs=perms(digs);
for i=1:length(setOfDigs)
digs=setOfDigs(i,:);
a=(bs*digs(1)+digs(2))^2;
b=(bs*digs(3)+digs(4))^2;
c=(bs*digs(5)+digs(6))^2;
if a+b==c
fprintf('%2d ',bs)
fprintf('%2d %2d ', digs)
fprintf(' ')
fprintf('%3d ', sqrt(a), sqrt(b), sqrt(c))
fprintf(' ')
fprintf('%5d ', a, b, c)
fprintf('\n')
end
end
end
end
checks all bases from 6 through 33 and finds
base digits decimal squares
a b c d e f ab cd ef (decimal)
10 3 6 2 7 4 5 36 27 45 1296 729 2025
10 2 7 3 6 4 5 27 36 45 729 1296 2025
14 7 6 5 8 9 4 104 78 130 10816 6084 16900
14 5 8 7 6 9 4 78 104 130 6084 10816 16900
16 7 8 5 10 9 6 120 90 150 14400 8100 22500
16 5 10 7 8 9 6 90 120 150 8100 14400 22500
So the first case is base 10: 36^2 + 27^2 = 45^2, so 10 is the minimum value of N asked for.
In the base-16 case, A is represented by 10.
Even going up to base 120, there seem to be no more bases in which this works.
|
Posted by Charlie
on 2023-05-24 12:44:36 |