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?
(In reply to
re(2): soln by Steven Lord)
It used to be that I would concatenate by converting to string, then doing an actual string concatenation and then converting back to numeric. In Visual Basic this didn't carry too much overhead, but I switched to MATLAB and used this method, there was too much overhead (not that this puzzle has that much going on). So I had to get myself used to the changing multiplication factor, so I might as well use it for this. The string conversion method doesn't require thinking about the lengths of the numbers.
|
Posted by Charlie
on 2020-12-01 14:52:17 |