Prob­lem

Find the unique pos­i­tive inte­ger whose square has the form 1_2_3_4_5_6_7_8_9_0,

where each “_” is a sin­gle digit.

Solu­tion

Ini­tially I started solv­ing this prob­lem by cre­at­ing all per­mu­ta­tions of 19 dig­its num­bers which fits the required pat­tern and iter­a­tively square root­ing them to find a square root which is a whole num­ber. Unfor­tu­nately thanks to round­ing errors this approach doesn’t give me the cor­rect answer so I resorted to iter­at­ing through the square roots and brute forc­ing it instead.

Share

Leave a Reply