Number $S$ is obtained by squaring the sum of digits of a two digit number $D$. If the difference between $S$ and $D$ is $27$, then the two digit number $D$ is?
My thoughts:
Let the two digit number $D$ be $AB$.
And so $S=(A+B)^2$
If $\,S-D=27,\,$ then $\,(A+B)^2 -AB=27$
$$A^2 + 2AB + B^2 - AB=27$$
Now how to obtain the value of $D$ further?
To try and approach systematically:
We know $|S-D|=27$.
Let $D$ is comprised of the digits $A$ and $B$, with each of $A, B$ each a single digit integer. Let $A$ be the left-most digit (the "ten's digit of $D$), and let $B$ be the right-most digit (the "one's" digit of $D$).
So $S = (A + B)^2$ and $D = 10 \cdot A + B.\;\;\;\;$(*)
Then $$|S - D| = 27 \iff |(A + B)^2 - (10A + B)| = 27, \quad (0 < A < 10, \;0 \le B < 10)$$
$$\quad\quad\quad\quad\quad\quad\quad\quad\iff (A+B)^2 - (10A + B) = 27,\quad\text{OR}\quad (10 A + B) - (A + B)^2 = 27$$ $$\text{with}\quad(0 < A < 10, \;0 \le B < 10)$$
(*) For example, if $D = 54$, then $D = 5 \cdot 10 + 4$, $S = (5 + 4)^2 = 81,\; S - D = 27$;
$\quad\;$ and if $D = 73 = 7\cdot 10 + 3\;\;, S = (7 + 3)^2 = 10^2 = 100; \;S - D = 27.$