A perfect square is represented by BCCDEFGGB, where each of the letters is denoted by a distinct nonzero digit.
Furthermore:
- Each of BCCD and EFGGB is a perfect square.
- Each of EF and GGB is a perfect square.
Determine the square root of the number represented by BCCDEFGGB.
Note: Computer program solutions are welcome but a semi-analytic (calculator+p&p) method is preferred.
digs='123456789'
asgn=combinator(9,6,'p');
for ch=1:length(asgn)
asg=digs(asgn(ch,:));
eval(['b=''' asg(1) ''';']);
eval(['c=''' asg(2) ''';']) ;
eval(['d=''' asg(3) ''';']);
eval(['e=''' asg(4) ''';']) ;
eval(['f=''' asg(5) ''';']);
eval(['g=''' asg(6) ''';']) ;
bccdefggb=str2double([b c c d e f g g b]);
if sqrt(bccdefggb)==floor(sqrt(bccdefggb))
ef=str2double([e f]);
ggb=str2double([g g b]);
bccd=str2double([b c c d]);
efggb=str2double([e f g g b]);
if sqrt(bccd)==floor(sqrt(bccd))
if sqrt(efggb)==floor(sqrt(efggb))
if sqrt(ef)==floor(sqrt(ef))
if sqrt(ggb)==floor(sqrt(ggb))
disp([bccdefggb sqrt(bccdefggb)])
disp([ef sqrt(ef)])
disp([efggb sqrt(efggb)])
disp([ggb sqrt(ggb)])
disp([bccd sqrt(bccd)])
end
end
end
end
end
end
finds
Value square
root
BCCDEFGGB 577681225 24035
EF 81 9
EFGGB 81225 285
GGB 225 15
BCCD 5776 76
|
Posted by Charlie
on 2023-04-10 14:30:16 |