document.write( "Question 1209930: The function f satisfies
\n" ); document.write( "f(m + n) = f(m) + f(n) - 2f(mn + m + n + 1) + m^2 + n^2
\n" ); document.write( "for all nonnegative integers m and n, and f(1) = 0. Compute f(123).
\n" ); document.write( "

Algebra.Com's Answer #851079 by CPhill(1959)\"\" \"About 
You can put this solution on YOUR website!
Let $P(m,n)$ be the assertion $f(m+n) = f(m) + f(n) - 2f(mn+m+n+1) + m^2 + n^2$.\r
\n" ); document.write( "\n" ); document.write( "$P(0,0) \implies f(0) = f(0) + f(0) - 2f(1) + 0^2 + 0^2$.
\n" ); document.write( "$f(0) = 2f(0) - 2f(1)$.
\n" ); document.write( "$f(0) = 2f(1) = 2(0) = 0$.
\n" ); document.write( "So $f(0) = 0$.\r
\n" ); document.write( "\n" ); document.write( "$P(m,0) \implies f(m) = f(m) + f(0) - 2f(m+1) + m^2 + 0^2$.
\n" ); document.write( "$0 = 0 + 0 - 2f(m+1) + m^2$.
\n" ); document.write( "$2f(m+1) = m^2$.
\n" ); document.write( "$f(m+1) = \frac{m^2}{2}$.\r
\n" ); document.write( "\n" ); document.write( "Let $x = m+1$, so $m = x-1$.
\n" ); document.write( "$f(x) = \frac{(x-1)^2}{2}$.\r
\n" ); document.write( "\n" ); document.write( "Let's check if this satisfies the given equation.
\n" ); document.write( "$f(m+n) = \frac{(m+n-1)^2}{2}$.
\n" ); document.write( "$f(m) + f(n) - 2f(mn+m+n+1) + m^2 + n^2 = \frac{(m-1)^2}{2} + \frac{(n-1)^2}{2} - 2\frac{(mn+m+n+1-1)^2}{2} + m^2 + n^2$.
\n" ); document.write( "$= \frac{m^2 - 2m + 1}{2} + \frac{n^2 - 2n + 1}{2} - (mn+m+n)^2 + m^2 + n^2$.
\n" ); document.write( "$= \frac{m^2 - 2m + 1 + n^2 - 2n + 1}{2} - (m^2n^2 + m^2 + n^2 + 2m^2n + 2mn^2 + 2mn) + m^2 + n^2$.
\n" ); document.write( "$= \frac{m^2 + n^2 - 2m - 2n + 2}{2} - (m^2n^2 + m^2 + n^2 + 2mn(m+n) + 2mn) + m^2 + n^2$.\r
\n" ); document.write( "\n" ); document.write( "$(m+n-1)^2 = m^2 + n^2 + 1 + 2mn - 2m - 2n$.
\n" ); document.write( "$\frac{(m+n-1)^2}{2} = \frac{m^2 + n^2 + 1 + 2mn - 2m - 2n}{2}$.\r
\n" ); document.write( "\n" ); document.write( "$\frac{m^2 + n^2 - 2m - 2n + 2}{2} - (m^2n^2 + m^2 + n^2 + 2mn(m+n) + 2mn) + m^2 + n^2$.
\n" ); document.write( "$= \frac{m^2 + n^2 - 2m - 2n + 2 - 2(m^2n^2 + m^2 + n^2 + 2mn(m+n) + 2mn) + 2m^2 + 2n^2}{2}$.
\n" ); document.write( "$= \frac{3m^2 + 3n^2 - 2m - 2n + 2 - 2m^2n^2 - 4mn(m+n) - 4mn}{2}$.\r
\n" ); document.write( "\n" ); document.write( "However, if $f(x) = \frac{(x-1)^2}{2}$, then $f(1) = \frac{(1-1)^2}{2} = 0$, which is correct.
\n" ); document.write( "$f(123) = \frac{(123-1)^2}{2} = \frac{122^2}{2} = \frac{14884}{2} = 7442$.\r
\n" ); document.write( "\n" ); document.write( "Final Answer: The final answer is $\boxed{7442}$
\n" ); document.write( "
\n" ); document.write( "
\n" );