3 ms·
Cool, thanks I was sitting there trying to think why it would fail for large numbers. But, (x * 10 + 5)^2 = x * x * 10 * 10 + 2 * x * 50 + 25 = x * (x + 1) * 1
by onemoreact 15y ago
Cool, thanks I was sitting there trying to think why it would fail for large numbers. But, (x * 10 + 5)^2 = x * x * 10 * 10 + 2 * x * 50 + 25 = x * (x + 1) * 100 + 2 .
- onemoreact 15y agoedit '+ 2 .' should be '+ 25.' so: (x * 10 + 5)^2 = x * x * 10 * 10 + 2 * x * 50 + 25 = x * (x + 1) * 100 + 25.