another approach might be to treat numbers as letters, squaring them is then represented algebraically as (a+b) ^ 2 == a^2 + b^2 + 2ab which can then be easily combined:
79^2 = 49, 126, 81 => 6241 a == 7, a^2 == 49
b == 9, b^2 == 81
2ab == 279 = 126
combination == (a^2+2ab+b^2)
from 81 take 1
add '8' to 2ab == 134, take 4
add '13' to 49 == 62
answer == 6241