What is the value of D here? 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?

I believe I see 2 solutions for this problem.  First let's redefine $D$ algebraicly as $D=10A+B$.  So our equation is
$$(A+B)^2-10A-B=27$$
I don't know if you know any modular arithmetic.  You may at least be aware of the divisibility test for $9$.  The sum of the digits of a number is closely related to its remainder when divided by $9$.  So it is a reasonable guess that we try to determine the remainder of both sides when divided by $9$.  This simplifies the equation to
$$(A+B)^2-A-B\equiv0\pmod9$$
$$(A+B)^2-(A+B)\equiv0\pmod9$$
$$(A+B)(A+B-1)\equiv0\pmod9$$
So we have the product of 2 consecutive integers has a remainder of $0$ when divided by $9$, or in other words this product is divisible by $9$. Since 2 consecutive numbers share no common factors besides $1$, either $A+B$ is divisible by $9$, or $A+B+1$ is divisible by $9$.  $D=99$ is too large and $D=10$ is too small, leaving 2 possibilities.
Our first possibility is $A+B=9$.  This gives us
$$S=9^2=81$$
$$D=S-27=81-27=54$$
Our second possibility is $A+B-1=9$ or $A+B=10$.  This yields
$$S=10^2=100$$
$$D=S-27=100-27=73$$
Both values check out.  $D$ is either $54$ or $73$.
