Two positive integers, a and b, are of 4 digits or less.
For what (a,b) pairs is it true that the sum of their squares is equal to their concatenation?
588 2353
2353 9412
(2353 seems somehow special...)
unremarkable code:
program ii
do i=1,9998
do j=i,9999
k=i**2+j**2
ij=10000*i+j
ji=10000*j+i
if(ij.eq.k.or.ji.eq.k)print*,i,j
enddo
enddo
end
Edited on December 1, 2020, 9:03 am