Find all functions $f:\mathbb Z\rightarrow \mathbb Z$ such that, for all integers $a,b,c$ that satisfy $a+b+c=0$, the following equality holds: \[f(a)^2+f(b)^2+f(c)^2=2f(a)f(b)+2f(b)f(c)+2f(c)f(a).\] (Here $\mathbb{Z}$ denotes the set of integers.) Proposed by Liam Baker, South Africa
Problem
Source:
Tags: algebra, functional equation, IMO, IMO Shortlist
11.07.2012 20:47
Easy to show: $f(0) = 0$ and $f(-t) = f(t)$ I don't know if I'm missing anything, but after trying several combinations, I arrived with the following solutions: $f(t) = 0$ for all $t$. OR $f(t) = 0$ for $t$ even and $f(t) = f(1)$ for $t$ odd OR $f(t) = 4f(1)$ for $t$ even and $f(t) = f(1)$ for $t$ odd OR $f(t) =t^2f(1)$ for any $f(1)$.
11.07.2012 20:55
[hide="Wrong proof, missed out the case of when $f(x_0)=0$ for $x_0\neq 0$"] Putting $a=b=c=0,$ we get $f(0)=0.$ Next, we put $c=0$ to note that $f(a)^2+f(b)^2=2f(a)f(b)\implies f(a)=f(b).$ So, $f$ is an even function. Now, putting $c=-a-b$ in the given equation leads to $P(a,b): f(a)^2+f(b)^2+f(a+b)^2=2f(a)f(b)+2f(a+b)[f(a)+f(b)].$ $P(a,a)\implies f(2a)[f(2a)-4f(a)]=0;$ and so $f(x)=0\forall x\in\mathbb Z$ is a trivial solution. So we may assume that $f(2a)=4f(a).$ $P(a,2a)\implies [f(3a)-9f(a)][f(3a)-f(a)]=0,$ which would lead to two possibilities. Case 1. $f(3a)=f(a).$ In this case, $P(a,8a)$ gives us $[f(9a)-65f(a)]^2=4\cdot 64f(a)^2,$ leading to $f(9a)=81f(a)$ or $f(9a)=49f(a).$ In either case, $f(9a)=f(3\cdot 3a)=f(3a)=f(a)$ is contradicted. Case 2. $f(3a)=9f(a).$ Now, we will go on to show that $f(ka)=k^2a$ for any $k\in\mathbb N,$ and since $f$ is even, so we may replace $\mathbb N$ with $\mathbb Z$ after the proof. Note that $f(2a)=4f(a)$ and $f(3a)=9f(a),$ so assume $f(ka)=k^2f(a).$ $P(a,ka)\implies f(a)^2+f(ka)^2+f((k+1)a)^2=2f(a)f(ka)+2f((k+1)a)(f(a)+f(ka));$ Which leads to $(k^4+1)f(a)^2+f((k+1)a)^2=2k^2f(a)^2+2f((k+1)a)(k^2+1)f(a);$ Or, $[(k-1)^2f(a)-f((k+1)a)][(k+1)^2f(a)-f((k+1)a)]=0.$ The first case gives us the solution $f(a)=0,$ and the second case helps us complete the proof of the claim by induction. Now, let $f(1)=c.$ Then $f(k)=k^2f(1)=k^2c.$ So, the solution to the equation is: $f(x)=0 \forall x\in\mathbb Z$ or, $f(x)=cx^2\forall x\in \mathbb Z.$ $\Box$[/hide] Vladimir has given a proof for the other case. I realised that my proof was flawed, but could not fix it.
11.07.2012 20:56
We have $4f(a)f(b)=(f(a+b)-f(a)-f(b))^2\,\; (*)\,\;\Rightarrow f(a)f(b)$ is perfect square. Let be the function : $g(x)=\pm\sqrt{\dfrac{f(x)}{c}}$, where $c$ is a constant (the sign of $g(x)$ is constant. By substitute in $(*)\Rightarrow g(a+b)^2=g(a)^2+g(b)^2+2g(a)g(b)$, so $g(a+b)=g(a)+g(b)$, which is the Cauchy equation. The solution of the problem is : $f(x)=x^2*c$, where $c$=constant. EDIT: I have a mistake : $f(a)f(b)=$ perfect square $\Rightarrow f(x)=x^2*c$ ($c\in \Bbb{Z}$) or for some $x,\,\; f(x)=0$. Thanks, Mellow Melon.
11.07.2012 21:00
Wow. I haven't heard anything about how people did on this one today, but it's very worrying that not one post in this topic has the correct solution set. (hendrata01 is close though, might have been a typo) [ EDIT: should be noted several earlier posts are now deleted, for obvious reasons ] (In all of these families, $a$ is an arbitrary integer) 1. $f(x) = ax^2$ 2. $f(x) = 0$ for even $x$, $f(x) = a$ for odd $x$ 3. $f(x) = 0$ for $x$ 0 mod 4, $f(x) = a$ for odd $x$, $f(x) = 4a$ for $x$ 2 mod 4
11.07.2012 21:02
socrates wrote: ... get $(f(a+b)-f(a)-f(b))^2=4f(a)f(b).$ --If $f(1)>0$ then $f(x)\geq 0$ for all $x$ and $\sqrt{f(x)}$ is Cauchy function. You seem to assume that then always $f(a+b)-f(a)-f(b)=2\sqrt{f(a)}\sqrt{f(b)}$, when it could be, for some values of $a,b$, also $f(a+b)-f(a)-f(b)=-2\sqrt{f(a)}\sqrt{f(b)}$.
11.07.2012 21:05
Potla How can you, from $f(2a)[f(2a)-4f(a)]=0$, make conclusion that either $f(2a)=0$ or $f(2a)-4f(a)=0$?
11.07.2012 21:07
$(f(a) - f(b))^2 = f(c) (2f(a) + 2f(b) - f(c))$ (i) $a = b = c = 0 \Rightarrow f(0) = 0$ (ii) $b = -a, c = 0 \Rightarrow f(-a) = f(a)$ (iii) $a = b = 1, c = -2 \Rightarrow f(2) = 0$ or $f(2) = 4f(1)$ (a) $f(2) = 0$ if $f(2k) = 0$ then $a = 2, b = 2k, c = -2k-2 \Rightarrow f(2k+2) = 0$ $\Rightarrow f(2n) = 0$ for all $n \in N$ $\Rightarrow$ for all odd $a, b$, $f(a) = f(b)$ solution for (a) $f(x) = c$ for odd $x$, $f(x) = 0$ for even $x$ (b) $f(2) = 4f(1)$ if $f(i) = i^2 f(1)$ for all $i \leq k$ then $a = 1, b = k, c = -k-1 \Rightarrow f(k+1) = (k+1)^2 f(1)$ or $f(k+1) = (k-1)^2 f(1)$ (b-1) if $f(k+1) = (k-1)^2 f(1)$ then $a=k+1, b=-k+1, c = -2 \Rightarrow f(2) = 0 or f(2) = 4 (k-1)^2 f(1)$ (b-1-1) if $f(2) = 0 \Rightarrow f(1) = 0$ if $f(i) = 0$ for all $i \leq k$ $a = k, b = 1, c = -k-1 \Rightarrow f(k+1) = 0$ solution for (b-1-1) $f(x) = 0$ for all $x$ (b-1-2) if $f(2) = 4(k-1)^2 f(1) \Rightarrow k = 2 \Rightarrow f(3) = f(1)$ and $f(2) = 4f(1)$ $a = 3, b = 1, c = -4 \Rightarrow f(4) = 0$ or $f(4) = 4f(1)$ if $f(4) = 4f(1)$ then $a = 2, b = 2, c = -4 \Rightarrow f(1) = 0 \Rightarrow $ same as (b-1-1) if $f(4) = 0$ then $a = k, b = 4, c = k+4 \Rightarrow f(k+4) = f(k)$ solution for (b-1-2) $f(4k) = 0, f(4k+2) = 4f(1), f(2k+1) = f(1)$ for all $k$ (b-2) if $f(k+1) = (k+1)^2 f(1)$ then $f(x) = x^2 f(1)$ for all $x$ solution for (b-2) $f(x) = x^2 f(1)$ ========================= solution $f(x) = c$ for odd $x$, $f(x) = 0$ for even $x$ or $f(x) = x^2 f(1)$ or $f(4k) = 0, f(4k+2) = 4f(1), f(2k+1) = f(1)$ for all $k$
11.07.2012 21:08
Mellow melon, how you have come to know the correct answer, are the answers disclosed after the exam? Can anyone post problems 5and 6 in a new forum?
11.07.2012 21:14
hendrata01 wrote: Easy to show: $f(0) = 0$ and $f(-t) = f(t)$ I don't know if I'm missing anything, but after trying several combinations, I arrived with the following solutions: $f(t) = 0$ for all $t$. OR $f(t) = 0$ for $t$ even and $f(t) = f(1)$ for $t$ odd OR $f(t) = 4f(1)$ for $t$ even and $f(t) = f(1)$ for $t$ odd OR $f(t) =t^2f(1)$ for any $f(1)$. counterexample for $f(t) = 4f(1)$ for $t$ even and $f(t) = f(1)$ for $t$ odd $a = b = 2, c = -4$ $3\cdot 16 f(1)^2 = 6 \cdot 16 f(1)^2 \rightarrow f(1) = 0$
11.07.2012 21:18
MellowMelon wrote: Wow. I haven't heard anything about how people did on this one today, but it's very worrying that not one post in this topic has the correct solution set. (hendrata01 is close though, might have been a typo) (In all of these families, $a$ is an arbitrary integer) 1. $f(x) = ax^2$ for any integer $a$ 2. $f(x) = 0$ for even $x$, $f(x) = a$ for odd $x$ 3. $f(x) = 0$ for $x$ 0 mod 4, $f(x) = a$ for odd $x$, $f(x) = 4a$ for $x$ 2 mod 4 Lol yeah sorry I did it in a hurry. It wasn't a typo, it was an honest mistake. I just saw the pattern for 1 2 3 and made a quick guess. But you get the idea. The most worrying thing is that people SEE the quadratic solution, get excited, and assume it's the only thing. I wonder how the judge will give partial credit if you only get the most obvious one. In IMO 2001 P4, they gave it a 1.
11.07.2012 21:18
Potla wrote: Putting $a=b=c=0,$ we get $f(0)=0.$ Next, we put $c=0$ to note that $f(a)^2+f(b)^2=2f(a)f(b)\implies f(a)=f(b).$ So, $f$ is an even function. Now, putting $c=-a-b$ in the given equation leads to $P(a,b): f(a)^2+f(b)^2+f(a+b)^2=2f(a)f(b)+2f(a+b)[f(a)+f(b)].$ $P(a,a)\implies f(2a)[f(2a)-4f(a)]=0;$ and so $f(x)=0\forall x\in\mathbb Z$ is a trivial solution. So we may assume that $f(2a)=4f(a).$ $P(a,2a)\implies [f(3a)-9f(a)][f(3a)-f(a)]=0,$ which would lead to two possibilities. Case 1. $f(3a)=f(a).$ In this case, $P(a,8a)$ gives us $[f(9a)-65f(a)]^2=4\cdot 64f(a)^2,$ leading to $f(9a)=81f(a)$ or $f(9a)=49f(a).$ In either case, $f(9a)=f(3\cdot 3a)=f(3a)=f(a)$ is contradicted. Case 2. $f(3a)=9f(a).$ Now, we will go on to show that $f(ka)=k^2a$ for any $k\in\mathbb N,$ and since $f$ is even, so we may replace $\mathbb N$ with $\mathbb Z$ after the proof. Note that $f(2a)=4f(a)$ and $f(3a)=9f(a),$ so assume $f(ka)=k^2f(a).$ $P(a,ka)\implies f(a)^2+f(ka)^2+f((k+1)a)^2=2f(a)f(ka)+2f((k+1)a)(f(a)+f(ka));$ Which leads to $(k^4+1)f(a)^2+f((k+1)a)^2=2k^2f(a)^2+2f((k+1)a)(k^2+1)f(a);$ Or, $[(k-1)^2f(a)-f((k+1)a)][(k+1)^2f(a)-f((k+1)a)]=0.$ The first case gives us the solution $f(a)=0,$ and the second case helps us complete the proof of the claim by induction. Now, let $f(1)=c.$ Then $f(k)=k^2f(1)=k^2c.$ So, the solution to the equation is: $f(x)=0 \forall x\in\mathbb Z$ or, $f(x)=cx^2\forall x\in \mathbb Z.$ $\Box$ $P(a,a)\implies f(2a)[f(2a)-4f(a)]=0;$ and so $f(x)=0\forall x\in\mathbb Z$ is a trivial solution. So we may assume that $f(2a)=4f(a).$ it can be $f(2x) = 0$ for some $x$, $f(2x) = 4f(x)$ for some $x$ you must prove $f(x) = 0$ for all $x$ if $f(c) = 0$ for some $c \ne 0$
11.07.2012 21:24
This reminds me of IMO2008 Q4. Both of them are functional equations, and both of them have traps in their solution.
11.07.2012 21:45
Indeed, The only correct answer here is that of MelowMellon, It'is based on the fact that if f(n)=0 (n>0), then it is suffiscient to define f in the set {0,...,n}. After finishing the case of f(1)=0 which give f=0, suppose that f(1)>0, f(2) is either 0 or 4f(1), f(3) is either f(1) or 9f(1), f(4) is either 0 or 16f(1) case 1 : f(2)=0, then f is constant for odd numbers and 0 for even numbers. case 2 : f(2)=4f(1) and f(3)=f(1), this leads to f(4)=0 then f(4k)=0 , f(4k+1)=f(4k+3)=f(1), f(4k+2)=4f(1). case 3 : f(2)=2f(1) , f(3)=9f(1) this gives f(4)=16f(1) induction leads to f(n)=n²f(1).
11.07.2012 22:17
KuMing wrote: $(f(a) - f(b))^2 = f(c) (2f(a) + 2f(b) - f(c))$ (i) $a = b = c = 0 \Rightarrow f(0) = 0$ (ii) $b = -a, c = 0 \Rightarrow f(-a) = f(a)$ (iii) $a = b = 1, c = -2 \Rightarrow f(2) = 0$ or $f(2) = 4f(1)$ (a) $f(2) = 0$ if $f(2k) = 0$ then $a = 2, b = 2k, c = -2k-2 \Rightarrow f(2k+2) = 0$ $\Rightarrow f(2n) = 0$ for all $n \in N$ $\Rightarrow$ for all odd $a, b$, $f(a) = f(b)$ solution for (a) $f(x) = c$ for odd $x$, $f(x) = 0$ for even $x$ (b) $f(2) = 4f(1)$ if $f(i) = i^2 f(1)$ for all $i \leq k$ then $a = 1, b = k, c = -k-1 \Rightarrow f(k+1) = (k+1)^2 f(1)$ or $f(k+1) = (k-1)^2 f(1)$ (b-1) if $f(k+1) = (k-1)^2 f(1)$ then $a=k+1, b=-k+1, c = -2 \Rightarrow f(1) = 0 \Rightarrow f(x) = 0$ (b-2) if $f(k+1) = (k+1)^2 f(1)$ then $f(x) = x^2 f(1)$ for all $x$ solution for (b) $f(x) = 0$ or $f(x) = x^2 f(1)$ ========================= solution $f(x) = c$ for odd $x$, $f(x) = 0$ for even $x$ or $f(x) = x^2 f(1)$ (b-1) if $f(k+1) = (k-1)^2 f(1)$ then $a=k+1, b=-k+1, c = -2 \Rightarrow f(2) = 0 or f(2) = 4 (k-1)^2 f(1)$ (b-1-1) if $f(2) = 0 \Rightarrow f(1) = 0$ if $f(i) = 0$ for all $i \leq k$ $a = k, b = 1, c = -k-1 \Rightarrow f(k+1) = 0$ solution for (b-1-1) $f(x) = 0$ for all $x$ (b-1-2) if $f(2) = 4(k-1)^2 f(1) \Rightarrow k = 2 \Rightarrow $f(3) = f(1)$ and $f(2) = 4f(1)$ $a = 3, b = 1, c = -4 \Rightarrow $f(4) = 0$ or $f(4) = 4f(1)$ if $f(4) = 4f(1)$ then $a = 2, b = 2, c = -4 \Rightarrow f(1) = 0 \Rightarrow $ same as (b-1-1) if $f(4) = 0$ then $a = k, b = 4, c = k+4 \Rightarrow $f(k+4) = f(k)$ solution for (b-1-2) $f(4k) = 0, f(4k+2) = 4f(1), f(2k+1) = f(1)$ for all $k$
12.07.2012 01:06
Taking $a=b=c=0$ gives $f(0)=0$. Taking $a, -a, 0$ we see that the function is even. Taking now discriminant at the given equation with respect to $f(a)$, we see that it equals $f(b)f(c)$ and it must be a square for every two $c,b$, hence $f(x)f(1)$ must be equal to $g^2(x)$ for a function $g$ which is a nonegative integer for every integer $x$. If $f(1) = 0$ it is easy to see that $f$ is $0$ everywhere, so let $f(1) \neq 0$. Solving with respect to $f(a) = f(b + c)$ and setting $f = \frac{g^2}{f(1)}$ and multiplying with $f(1)$, we get $g(b+c) = |g(b) \pm g(c)|$ for every two integers $b,c$. Moreover, we have that $|f(1)| = g(1)$ and $g(b+1) = |g(b) \pm g(1)|$ and by induction it is easy to see that $g(1)=|f(1)|$ divides $g(x)$ for every integer $x$. Let $g(x) = g(1)h(x)$ for every $x$, then $h$ is an even function defined over the integers, with nonegative integer values, $h(b+c) = |h(b) \pm h(c)|$ for every two integers $b,c$, and $h(1) = 1$. Moreover $h(b+1) = |h(b) \pm 1|$ From the above relation we see that $h(2) = 0$ or $2$. If $h(2) = 0$, obviously $h(x) = x (mod2)$, or $h \equiv 0$. If $h(2)=2$ then we have the cases $h(3)=1$ or $h(3) = 3$. If $h(3) = 1$ then either $h(4) = 0$ which easily gives that over the naturals $h$ is the sequence $0,1,2,1,0,1,2,1,0 ...$, either $h(4)=2$ with $h(4) = 2h(2)$ or $0$ which is impossible. If $h(3) = 3$, we claim that $h(k) = k$ for every natural $k$. If not, then there exist a natural number $m \geq 2$, such that $h(m) = h(m+2)$ and suppose that this is the mimimum among these natural numbers. It is easy to see that $h$ increases from $2$ to $m$, and $2 = h(2) = h(m+2 - m) = h(m+2) + h(m) = 2h(m)$ (because otherwise it would be zero) and hence $h(m) = 1$, contradiction because $h(m) \geq h(2) = 2$ because $h$ increases from $2$ to $m$. The extension to the integers follows because $h$ is even. Hence we have $f(n)f(1) = g^2(1)h^2(n) \Leftrightarrow f(n) = f(1)h^2(n)$ if $f(1) \neq 0$. From the above, we have that $f(n) = mh^2(n) \forall n \in \mathbb{Z}$, where $m$ is an integer and $h$ is even and: $h(n) = n \forall n \in \mathbb{N}$ or $h(n), n \in \mathbb{N}$ is the sequence $0,1,0,1,0,1,0,...$ or $h(n), n \in \mathbb{N}$ is the sequence $0,1,2,1,0,1,2,...$ If my calculations are correct, all these three functions are solutions of the given functional equation (the calculations for the two last functions are simple if we use the fact that $h$ is $2$ and $4$ - periodic). Edit: there was a mistake with the latex formula used and the solution looked like a wrong one.
12.07.2012 03:37
From $a = b = c =0$, we obtain $f(0) = 0.$ From $c = 0$ and $b = -a$, we get $f(a) = f(-a).$ Since $c = -a-b$, the functional equation rewrites as: \[P(a,b) := f(a)^2 + f(b)^2 + f(a+b)^2 = 2f(a)f(b) + 2f(a+b)\cdot[f(a) + f(b)] \ \forall a, b \in \mathbb{Z}.\] Notice that $P(a, -b) \implies f(a)^2 + f(b)^2 + f(a-b)^2 = 2f(a)f(b) + 2f(a-b)\cdot[f(a) + f(b)].$ Summing $P(a,-b)$ and $P(a,b)$, we get \[[f(a+b) + f(a-b)]\cdot [f(a+b) - f(a-b)] = 2[f(a)+f(b)]\cdot [f(a+b)-f(a-b)].\] Hence, for any pair of integers $a,b$, either $f(a+b) = f(a-b)$ or $f(a+b) + f(a-b) = 2[f(a)+f(b)].$ In particular, $a = b= 1$ gives $f(2) = 0$ or $f(2) = 4f(1).$ $\text{I)} f(2) = 0.$ Then $P(a, 2) \implies f(a)= f(a+2) \ \forall a \in \mathbb{Z}.$ If $a$ is even, then $f(a) = f(2) = 0.$ If $a$ is odd, then $f(a) = c$ is a constant, and this function indeed satisfies the original equation $\forall c \in \mathbb{Z}.$ $\text{II)} f(2) = 4f(1).$ Let $f(1) = c.$ Suppose $f(a) = n^2 \cdot c$ for some integer $n.$ Then $P(a,1)$ gives $f(a+1) = c(n\pm1)^2.$ Similarly, $P(a,2)$ gives $f(a+2)= c(n\pm2)^2.$ Therefore, $f(3) \in \{c, 9c\}.$ We split the problem into two subcases: $\circ\ f(3) = 9c.$ I claim that, in this case, $f(a) = a^2 \cdot c$ for all positive integers $a.$ Suppose the claim is true for $a-1$ and $a$, with $a > 2.$ Then $f(a+1) \in \{c(a-1)^2, c(a+1)^2\}$, and also $f(a+1) \in \{c(a-3)^2, c(a+1)^2\}$, which imply $f(a+1) = c(a+1)^2$ since $c(a-3)^2 \neq c(a-1)^2$ for $a>2.$ Hence, by induction, $f(a) = a^2 \cdot c$, which is indeed a solution. $\circ\ f(3) = c.$ Then with a similar inductive argument, we obtain $f(a) = c$ for $a$ odd, $f(a) = 0$ for $4|a$, and $f(a) = 4c$ for $a$ congruent to $2 \mod 4.$ Thus the solution set: $\circ\ f(x) = 0$ for $x$ even and $f(x) = c$ for $x$ odd; $\circ\ f(x) = cx^2$ for any $x \in \mathbb{Z}$; $\circ\ f(x) = c$ for $x$ odd, $f(a) = 0$ for $4|a$ and $f(a) = 4c$ for $a \equiv 2 \mod 4.$
12.07.2012 06:03
I think this problem is much more difficult than problem2 this year. That's strange.
12.07.2012 06:13
Heyyyyy where is PCO's solutionnnnn?
12.07.2012 10:04
Set $a=b=c=0$ to find $f(0)=0$. Set $a=0, b=-c$ to find $f(x)=f(-x)$. Rewriting as $(f(c)-f(a)-f(b))^2=4f(a)f(b)$ implies $f(x)$ has the same sign for each $x$. WLOG $f(x) \ge 0$. Set $g(x)=\sqrt{f(x)}$, so $g(x)=g(-x)$, $g(x) \ge 0$ and $g(0)=0$. Claim 1 $g(a+b) \in \{g(a)+g(b), |g(a)-g(b)| \}$ for all $a,b$ Substituting $f(x)=g(x)^2$, we find $(g(a)+g(b)+g(c))(g(a)+g(b)-g(c))(g(b)+g(c)-g(a))(g(c)+g(a)-g(b))=0$, and the result follows easily after letting $c=-a-b$ and noting $g(-a-b)=g(a+b)$. Claim 2 $g(kx) \in \{kg(x),(k-2)g(x),...,\frac{1+(-1)^{k+1}}{2}\}$ From Claim 1, $g(kx) = |g(x) \pm g(x) \pm ... \pm g(x) |$ and the result follows. If $g(1)=0, g(x)=f(x)=0$ for all $x$ by Claim 2. Otherwise, let $g(1)=t>0$. From $g(2^kx)=g(2\cdot 2^{k-1}x)$ we find by Claim 1 and an easy induction that $g(2^kx) \in \{0, 2^kg(x) \}$. Set $k \in S$ if $g(2^k)=2^kt$, and $k \in T$ otherwise. Case 1 $|S|= \infty$. An induction on $\ell$ gives $g(2^k-\ell)=(2^k-\ell)t$ for $1 \le \ell \le 2^k-1$, $k \in S$, so $g(x)=tx$ for $x \ge 0$ Case 2 $|T|= \infty$. Let $u$ be the minimum positive integer such that $g(2^u)=0$. Case 2a $u=1$. From Claim 2, $g(2\ell)=0$ for $\ell \in \mathbb{Z}_+$. It follows immediately that $g(m)=g(n)=t$ for any odd $m,n \ge 0$. Case 2bi $u>1$. Suppose $f(4)=0$. Then $f(4k)=0$ for every positive integer $k$, and it follows immediately that $g(m)=g(n)=2t$ for even $m,n \ge 0$ not divisible by $4$, and that $g(m)=g(n)=t$ for any odd $m,n \ge 0$. Case 2bii $g(4)=4t$. Then we must also have $g(3)=3t$. From $g(k) \in \{g(k-1)+t, |g(k-1)-t| \} \cap \{g(k-2)+2t, |g(k-2)-2t| \}$ we find by induction on $k$ that $g(k)=kt$ for $k \ge 5$. Since $g(-x)=g(x)$, $g(0)=0$, the following are the only solutions, where $t \in \mathbb{Z}$: (a) $f(x)=tx^2$ (b) $f(x)=t$ for $x$ odd and $f(x)=0$ for $x$ even (c) $f(x)=t$ for $x$ odd, $f(x)=0$ for $x$ divisible by $4$, and $f(x)=4t$ otherwise. It is easy to check they satisfy the equation.
05.08.2022 16:52
ISL Marabot solve Let, $P(a,b,c)$ be the assertion of, \[ f(a)^2+f(b)^2+f(c)^2=2f(a)f(b)+2f(b)f(c)+2f(c)f(a)\]$$\implies (f(c)-f(a)-f(b))^2=4f(a)f(b)$$Now, $P(0,0,0) \implies f(0) = 0$. So, $P(a,-a,0)\implies (f(a)-f(-a))^2=0 \implies f(a) = f(-a)$ Therefore, $P(a,b,-a-b)\implies P(a,b,a+b)$ and the first one is true from the statement. Now, $$P(a,b,a+b)\implies (f(a+b)-f(a)-f(b))^2=4f(a)f(b)$$$$\implies f(a+b) = f(a)+f(b) \pm 2\sqrt{f(a)f(b)}\qquad (\clubsuit)$$Now, let $f(1)=c$. If $f(a) = k^2c$ then putting $b=1$ gives, $$f(a+1) = (k+1)^2c \text{ or } (k-1)^2c \qquad (\spadesuit)$$Now, we get two cases, $f(2)=4c$ and $f(2)=0$. $\boxed{\textbf{Case 1: } f(2)=0}$ In this case, by putting $b=2$ in $(\clubsuit)$ we get, $$f(a+2) = f(a)$$Which gives, our first solution $f(x) = c$ for odd $x$ and $f(x)=0$ for even $x$. And it's easy to check that this solution works. $\boxed{\textbf{Case 1: } f(2)=4c}$ In this case, if we always use the $+$ in $(\spadesuit)$ then we get our second solution $f(x)=x^2c$ and it's easy to see that this solution works. Now let, $a_0$ be the first positive integer for which we use the $-$ in $(\spadesuit)$ then, $f(a_0-1) = f(a_0+1) = (a_0 -1)^2c$. But by putting $a=a_0-1,b=2$ in $(\clubsuit)$ we get, $$(a_0 -1)^2c =f(a_0+1) = (a_0+1)^2c \text{ or } (a_0-3)^2c$$Which gives, $a_0=0$ or $a_0=2$ so it must be $2$. Therefore, $f(3)=c$, and by using $(a,b)= (3,1)$ and $(2,2)$ in $(\clubsuit)$ we get $f(4) = 0$. Then putting $b=4$ in $(\clubsuit)$ gives, $$f(a+4) = f(a)$$And from this we get our $3$rd solution to the function, $f(x) = c$ for odd $x$, $f(x) =0$ if $4|x$ and $f(x) = 4c$ otherwise. And it can be shown that this also satisfies the equation. $\blacksquare$
07.08.2022 11:56
$P(0,0,0) : f(0) = 0$ $P(a,0,-a) : f(a)^2 + f(-a)^2 = 2f(a)f(-a) \implies f(a) = f(-a)$ $P(2a,-a,-a) : f(2a)^2 + 2f(a)^2 = 4f(2a)f(a) + 2f(a)^2 \implies f(2a)^2 = 4f(2a)f(a)$ Case $1 : f(2a) = 0$ for every odd $a,b$ from $P(a,b,-a-b) : f(a)^2 + f(b)^2 = 2f(a)f(b) \implies f(a) = f(b)$ so $f(x) = 0$ for every even $x$ and $f(x) = c$ for every odd $x$. Case $2 : f(2a) = 4f(a)$ Note that we have $f(2) = 4f(1)$. By induction assume that for $1 \le n \le N, f(n) = n^2f(1)$. $P(N,1,-N-1) : N^4f(1)^2 + f(1)^2 + f(N+1)^2 = 2N^2f(1)^2 + 2f(1)f(N+1) + 2N^2f(1)f(N+1)$ so $f(N+1) = (N+1)^2f(1)$ or $(N-1)^2f(1)$ Case $2_1 : f(N+1) = (N+1)^2f(1)$ By induction for every positive $x$, $f(x) = x^2f(1)$ since $f(x) = f(-x)$ and $f(0) = 0$ then $f(x) = x^2f(1)$. Case $2_2 : f(N+1) = (N-1)^2f(1)$ $f(N+1) = (N-1)^2f(1) = f(N-1) \implies f(1) = f(3)$ $P(1,3,-4) : f(4)^2 = 2f(4)f(1) + 2f(4)f(3) = 4f(4)f(1)$. Case $2_{2_1} : f(4) = 4f(1)$ $4f(2) = f(4) = 4f(1) = f(2) \implies f(1) = 0 \implies f(x) = 0$ which in fact is what we got in case $1$. Case $2_{2_2} : f(4) = 0$ $P(N,4,-N-4) : f(N)^2 + f(N+4)^2 = 2f(N)f(N+4) \implies f(N) = f(N) + 4$ so $f(a) = f(b)$ when $a \equiv b (mod 4)$ so $f(4x) = 0 , f(4x+2) = 4f(1) = 4f(2x+1)$.
20.10.2022 02:23
Why is the solution set so weird. Here's a walkthrough: 1. P(0,0,0) implies f(0)=f(0) 2. P(a, -a, 0) implies f is even 3. We can rewrite the condition to work for all $a+b=c$. 4. P(1,1,2) gives $4f(1)=f(2)$. 5. If $f(2)=0$, a straightforward induction shows that $f(2x)=0$ for all integers $x$ and $f(2x-1)=c$ for some constant $c$. 6. If $f(2)=4f(1)$, then $P(1,2,3)$ gives us $f(3)^2-10af(3) + 9a^2 =0$ or $(f(3)-9a)(f(3)-a)=0$, implying that $f(3)=a,9a$. If $f(3)=a$, we can induct to get $f(x) =0$ for $x\equiv 0 \pmod 4$, $f(x)=c$ for $x\equiv 1\pmod 2$, and $f(x)=4c$ for $x\equiv 2 \pmod 4$. If $f(3)=9a$, then we can induct to get $f(x) = ax^2$, so another solution is $f(x)=cx^2$.
01.12.2022 19:38
21.12.2022 06:58
writing this up from before because I'm bored We claim the only solutions are $$f(x)=\begin{cases}0\qquad x \equiv 0 \pmod 2 \\ c\qquad x \equiv 1 \pmod 2\end{cases}$$$$f(x)=\begin{cases}0\qquad x\equiv 0\pmod 4 \\ c\qquad x\equiv 1,3\pmod 4 \\ 4c\qquad x\equiv 2\pmod 4\end{cases}$$$$f(x)=cx^2.$$ Now, we show they are the only ones. Let $P(a,b,c)$ be the assertion. Then, $P(0,0,0) \rightarrow f(0)=0$. $P(a,-a, 0) \rightarrow f(a)=f(-a) \rightarrow f \text{ even }$. $P(a,a,-2a) \rightarrow f(2a) = 0 \text{ or } f(2a) = 4f(a)$. Claim: If $f(x)=0$, then $f(cx) = 0$ for all integers $c$. Proof. Use induction, with the base case trivial. Assume $f(x)=f(2x)=\dots=f(cx-c)=0$. Then, $$P(x, cx-c, -cx) \rightarrow f(cx)=0. \square$$ Now we casework on $f(1), f(2), f(4)$. Case 1: $f(2)=0, f(1) \neq 0$. By the claim, $f(x)=0$ for even $x$. Let $n,m$ be odd integers. Then $$P(n,m,1-n-m) \rightarrow f(n)=f(m),$$which means $f(x)=c$ for odd $x$. Case 2: $f(4)=0, f(1), f(2) \neq 0$. We have $f(x)=0$ for $x \equiv 0 \pmod 4$. Let $n \equiv 1 \pmod 4, m \equiv 3 \pmod 4$. Then $$P(n,m,-n-m) \rightarrow f(n)=f(m),$$which implies $f(x)$ is constant for odd $x$. Now, let $n\equiv 2 \pmod 4$. Note that $f(n) \neq 0$, as otherwise $P(-2, 2-n, n)$ would yield a contradiction. Thus, $f(x)=4x$ for $x \equiv 2 \pmod 4$. Case 3: $f(1), f(2), f(4) \neq 0$. Note that $f(2) = 4f(1), f(4) = 16f(1)$. Then, $$P(-1, -2, 3) \rightarrow f(3) = f(1) \text{ or } f(3) = 9f(1).$$Similarly, $$P(-1,-3,4) \rightarrow f(3) = 9f(1) \text{ or } f(3) = 25f(1),$$and combining gives $f(3)=9f(1)$. We can use a similar argument inductively to show that $f(x)=cx^2$. Case 4: $f(1)=0$. This implies $f(x)=0$ which falls under the solution previously found in Case 3. Since all the solutions work and we have exhausted all cases, we are done. $\blacksquare$
21.10.2023 11:13
Let $P(a, b, c)$ denote the assertion. Quick facts: \begin{align*} P(0, 0, 0): f(0) &= 0 \\ P(a, -a, 0): f(a) &= f(-a) \end{align*}so we get that $f$ is even. Letting $c = - a - b$, we have $$f(a)^2 + f(b)^2 + f(a + b)^2 = 2f(a)f(b) + 2f(a+b)[f(a) + f(b)].$$Using the quadratic formula to solve for $f(a + b)$ gives us $$f(a + b) = f(a) + f(b) \pm 2 \sqrt{f(a)f(b)} \qquad{(1)}.$$This tells us a couple of things. The $\sqrt{f(a)f(b)}$ tells us that $f$ must have the same sign everywhere. Furthermore, if we allow $b = 1$, then this means $$f(a) = \frac{g(a)^2}{f(1)}$$for some $g(a) \ge 0$, unless $f(1) = 0$. Note that if $f(1) = 0$, then by Equation (1), we have $f(a + 1) = f(a)$, so $f(a) = 0$ everywhere. So assume that $f(1) \neq 0$. Replacing all $f$s with $g$s in Equation (1) yields \begin{align*} g(a + b)^2 &= g(a)^2 + g(b)^2 \pm 2g(a)g(b) \\ \Longrightarrow g(a + b) &= |g(a) \pm g(b)| \qquad{(2)}. \end{align*}We know $g(0) = 0$, and let $g(1) = k$ for some positive integer $k$. Let $Q(a, b)$ denote plugging in $a$ and $b$ into equation (2). By $Q(1, 1)$, we have $g(2) = |k \pm k|$, so we have two cases. Case 1: $g(2) = 0$. Using $Q(x, 2)$ gives us $g(x + 2) = g(x)$, and so we have $g(x) = 0$ for even $x$ and $g(x) = k$ for odd $x$. Case 2: $g(2) = 2k$. By $Q(2, 1)$, we have $g(3) = k$ or $g(3) = 3k$. Case 2.1: $g(3) = k$. Then, $Q(3, 1)$ tells us $g(4) = 0$ or $2k$. But if $g(4) = 2k$, then $Q(2, 2)$ is a contradiction. So, $g(4) = 0$, and now by $Q(x, 4)$, we get that $g$ is periodic with period $4$, and this determines all of $g$. Case 2.2: $g(3) = 3k$. We shall use induction to show that $g(n) = nk$ for all positive $n$, with the base case of the first three $n$ handled. Suppose $g(n - 2) = (n-2)k$ and $g(n - 1) = (n-1)k$. Then we have \begin{align*} Q(n - 2, 2): g(n) &= nk \text{ or } (n - 3)k \\ Q(n - 1, 1): g(n) &= nk \text{ or } (n - 2)k \end{align*}Notice that there are no absolute value signs here because $n \ge 3$. The only overlapping value for $g(n)$ is $nk$, and so we complete our induction. Solutions: Wrapping up, we have shown that the only admissible solutions are $g(x) = 0$ $g(x) = k$ for $x \equiv 1 \pmod{2}$ and $0$ otherwise $g(0) = 0$, $g(1) = k$, $g(2) = 2k$, and $g(3) = k$, and $g(x) = g(x \pmod{4})$ for all other $x$. $g(x) = kx$ for all $x$. Then, take $f(x) = c \cdot g(x)$ for any integer $c$. It is easy to see that all of these are valid solutions.
05.12.2023 05:25
There are three classes of solutions to this functional equations; one of them is the nice polynomial function $x \mapsto cx^2$. The other two classes of solutions can be viewed as a function induced from a solution to the same functional equation but with signatures $\mathbb{Z}/2\mathbb{Z} \to \mathbb{Z}$ and $\mathbb{Z}/4\mathbb{Z} \to \mathbb{Z}$, respectively. In general, there is one missing class, induced from a solution with signature $(\mathbb{Z}/2\mathbb{Z})^2 \to \mathbb{Z}$. Of course, it doesn't appear in this problem since $(\mathbb{Z}/2\mathbb{Z})^2$ is not a group quotient of $\mathbb{Z}$. Quote: Let $(G, +)$ be an abelian group and $R$ be an integral domain (with $char(R) \neq 2, 3$). Say that $(a, b, c) \in R^3$ is a Heron triple if $a^2 + b^2 + c^2 = 2ab + 2bc + 2ca$. Find all functions $f : G \to R$ such that $(f(x), f(y), f(z))$ is a Heron triple for any $x, y, z \in G$ with $x + y + z = 0$. The case $char(R) = 2$ is not very interesting on itself; the answers are precisely the group homomorphisms. On the other hand, the case $char(R) = 3$ to be more complicated than the case $char(R) \neq 3$, since we don't even have $f(0) = 0$ guaranteed anymore! Answer. A function $f : G \to R$ satisfies the desired properties iff it has one of the following properties: there exists $c \in R$ non-zero and a group homomorphism $\phi : G \to R$ such that $c f(x) = \phi(x)^2$ for any $x \in G$; there exists $c \in R$ and a surjective group homomorphism $\phi : G \to \mathbb{Z}/2\mathbb{Z}$ such that \[ f(x) = \begin{cases} 0, & \phi(x) = 0, \\ c, & \phi(x) = 1; \end{cases} \] there exists $c \in R$ and a surjective group homomorphism $\phi : G \to \mathbb{Z}/4\mathbb{Z}$ such that \[ f(x) = \begin{cases} 0, & \phi(x) = 0, \\ c, & \phi(x) = \pm 1, \\ 4c, & \phi(x) = 2; \end{cases} \] there exists a Heron triple $(a, b, c) \in R^3$ and a surjective group homomorphism $\phi : G \to (\mathbb{Z}/2\mathbb{Z})^2$ such that \[ f(x) = \begin{cases} 0, & \phi(x) = (0, 0), \\ a, & \phi(x) = (1, 0), \\ b, & \phi(x) = (0, 1), \\ c, & \phi(x) = (1, 1). \end{cases} \] Since $R$ is an integral domain with $char(R) \neq 3$, for any $r \in R$, $(r, r, r)$ is a Heron triple iff $3r^2 = 0 \iff r = 0$. In particular, $f(0) = 0$. Since $R$ is an integral domain, for any $r, s \in R$, $(0, r, s)$ is a Heron triple iff $r = s$. Together with $f(0) = 0$, plugging $x = 0$ and $z = -y$ gives $f(y) = f(-y)$ for any $y \in G$; i.e., $f$ is even. Note that this only requires $f(0) = 0$, but not $char(R) \neq 3$. In particular, the original condition is now equivalent to $(f(x), f(y), f(x + y))$ being a Heron triple for any $x, y \in G$. Some parts of the solution will assume that $char(R) \neq 3$, and some parts only assume that $f(0) = 0$. First, notice that if $f(x) = 0$, then $(f(x + y), f(y), 0)$ is a Heron triple and thus $f(x + y) = f(y)$ for any $y \in G$. This means that $f^{-1}(0)$ is a subgroup of $G$, and that we have a well-defined induced map $\tilde{f} : G/f^{-1}(0) \to R$ satisfying $\tilde{f}([x]) = f(x)$ for any $x \in G$, and one can check that $\tilde{f}$ is good as well, i.e., $(\tilde{f}(x), \tilde{f}(y), \tilde{f}(x + y))$ is a Heron triple for any $x, y \in G/f^{-1}(0)$. Thus, we may assume that $f^{-1}(0) = \{0\}$ whenever necessary, as we can just replace $G$ with the quotient group $G/f^{-1}(0)$. Rearranging the Heron triple condition yields $(f(x + y) - f(x) - f(y))^2 = 4 f(x) f(y)$ for any $x, y \in G$. Thus, for any $x, y \in G$, since $(f(x - y), f(x), f(y))$ and $(f(x + y), f(x), f(y))$ are Heron triples, we get $(f(x + y) - f(x) - f(y))^2 = (f(x - y) - f(x) - f(y))^2 = 4 f(x) f(y)$, and thus \[ f(x + y) = f(x - y) \vee f(x + y) + f(x - y) = 2 f(x) + 2 f(y) \quad \forall x, y \in G. \tag{1} \]In particular, this gives $f(2x) \in \{0, 4 f(x)\}$ for any $x \in G$. We now divide into three cases: Case 1. $f(2x) = 4 f(x)$ for all $x \in G$. The corresponding answer is the first category shown above. To motivate the solution, you should think that $f$ is supposed to be similar to the square function. If $f \equiv 0$ then we are done, so now suppose that $f(g_0) \neq 0$ for some $g_0 \in G$. If $f$ is the square function, then $f(x + y) - f(x) - f(y)$ would be bilinear in terms of $x$ and $y$; it becomes linear if we fix one of $x$ or $y$. Thus it makes sense to guess that $c = 4 f(g_0)$ and $\phi(x) = f(x + g_0) - f(x) - f(g_0)$ works; it already satisfies $c f(x) = \phi(x)^2$ for all $x \in G$, and $c \neq 0$ since $f(g_0) \neq 0$ and $4 = 2^2 \neq 0$ in $R$. It remains to show that $\phi$ is indeed a group homomorphism, which reduces to showing the following equality by substituting $z = g_0$: \[ f(x + y + z) + f(x) + f(y) + f(z) = f(x + y) + f(y + z) + f(z + x) \quad \forall x, y, z \in G. \] We first show that $f(x + y) + f(x - y) = 2 f(x) + 2 f(y)$ for any $x, y \in G$. By (1), either we are done or we can assume $A = f(x + y) = f(x - y)$. Then $(A, A, f(2x))$ and $(A, A, f(2y))$ are Heron triples, forcing $f(2x) = f(2y) = 4A$. By the case's hypothesis, this implies $f(x) = f(y) = A$. But then $(A, A, A) = (f(x), f(y), f(x + y))$ is a Heron triple, which forces $A = 0$ due to $char(R) \neq 3$. This also yields $f(x + y) + f(x - y) = 2 f(x) + 2 f(y)$, as desired. Now the proof of the main equality is as follows: for any $x, y, z \in G$, \[ 2 f(x + y + z) + 2 f(x) + 2 f(y) + 2 f(z) = f(2x + y + z) + f(y + z) + f(y + z) + f(y - z) = 2 f(x + y) + 2 f(x + z) + 2 f(y + z). \]The second equality holds since $2x + y + z = (x + y) + (x + z)$ and $y - z = (x + y) - (x + z)$. Now $char(R) \neq 2$ and $R$ is an integral domain, so we can cancel the factor of $2$ out and we are done. Case 2. $f(2x) = 0$ for all $x \in G$. The corresponding solutions fall into the second and fourth category. Using the quotient $G/f^{-1}(0)$, we now assume that $f^{-1}(0) = \{0\}$. In particular, the case's hypothesis implies that $G$ is $2$-torsion, or equivalently an $\mathbb{F}_2$-vector space. The claim about what the solutions are is equivalent to saying that $G$ has dimension at most $2$. It now suffices to show that $\dim_{\mathbb{F}_2}(G) \leq 2$, i.e., any $3$ elements of $G$ are linearly dependent over $\mathbb{F}_2$. Fix some elements $x, y, z \in G$; the goal is to show that one of $x, y, z$, $x + y, x + z, y + z$, or $x + y + z$ equals zero. Recall that $a^2 + b^2 + c^2 = 2ab + 2bc + 2ca$ can be rearranged to $(c - a - b)^2 = 4ab$. Then $4 f(x) f(w)$ is a square for each $w \in \{x, y, z, x + y, x + z, y + z, x + y + z\}$. For each $\alpha, \beta, \gamma \in \{0, 1\}$ (i.e. $\mathbb{F}_2$), pick some $r_{\alpha \beta \gamma} \in R$ such that $4 f(x) f(\alpha x + \beta y + \gamma z) = r_{\alpha \beta \gamma}^2$. We can change $r_{\alpha \beta \gamma}$ to $-r_{\alpha \beta \gamma}$ if desired. Since $(f(x), f(y), f(x + y))$ is Heron, after multiplying by $(4 f(x))^2$, we get that $(r_{100}^2, r_{010}^2, r_{110}^2)$ is also Heron, which forces $r_{110} = r_{100} \pm r_{010}$. The same method yields $r_{\mathbf{v}_1 + \mathbf{v}_2} = r_{\mathbf{v}_1} \pm r_{\mathbf{v}_2}$ for each $\mathbf{v}_1, \mathbf{v}_2 \in \mathbb{F}_2^3$. Fix a sign of $r_{100}$, then choose a sign for $r_{010}$ such that $r_{110} = r_{100} + r_{010}$, and then choose a sign for $r_{001}$ such that $r_{111} = r_{110} + r_{001} = r_{100} + r_{010} + r_{001}$. Now we list some values of $f$: \begin{align*} f(x) &= r_{100}^2 \\ f(y) &= r_{010}^2 \\ f(z) &= r_{001}^2 \\ f(x + y) &= (r_{100} + r_{010})^2 \\ f(x + z) &= (r_{100} \pm r_{001})^2 \\ f(y + z) &= (r_{010} \pm r_{001})^2 \\ f(x + y + z) &= (r_{100} + r_{010} + r_{001})^2 \end{align*}Recall that the goal is to show that at least one of the entries above is equal to $0$. Suppose for the sake of contradiction that none of them are zero. We just case-bash based on the choices of sign in the two $\pm$s. First, since $(f(x), f(y + z), f(x + y + z))$ is Heron, we get that $f(y + z)$ is equal to either $(r_{010} + r_{001})^2$ or $(2 r_{100} + r_{010} + r_{001})^2$. In the latter case, some choices of sign of $\pm$ yields $2 r_{100} + r_{010} + r_{001} = \pm r_{010} \pm r_{001}$. If both signs are $-$, then $r_{100} + r_{010} + r_{001} = 0$ and thus $f(x + y + z) = 0$. If both signs are $+$, then $r_{100} = 0$. If one of the sign is $-$, say $2 r_{100} + r_{010} + r_{001} = -r_{010} + r_{001}$, then $r_{100} + r_{010} = 0$ and thus $f(x + y) = 0$; so $f(y + z) = (2 r_{100} + r_{010} + r_{001})^2$ yields a contradiction. The only case remaining is that $f(y + z) = (r_{010} + r_{001})^2$. By symmetry, avoiding contradiction also yields $f(x + z) = (r_{100} + r_{001})^2$. Now consider that $(f(x + y), f(x + z), f(y + z))$ is Heron. This implies that, for some choice of the signs $\pm$, \[ \pm (r_{100} + r_{010}) \pm (r_{100} + r_{001}) \pm (r_{010} + r_{001}) = 0. \]WLOG suppose that at least two of the signs are $+$. If all three are equal to $+$, then we get $r_{100} + r_{010} + r_{001} = 0$ and thus $f(x + y + z) = 0$. Otherwise, WLOG the signs for $r_{100} + r_{010}$ and $r_{100} + r_{001}$ are $+$. Then the previous equality becomes $2 r_{100} = 0$, which yields that $r_{100} = 0$ and thus $f(x) = 0$; a contradiction as well. All cases yield a contradiction, so one of the seven values shown above must be equal to $0$. We are done. (There should be an alternative way, free of the above kind of bash, but either I didn't actually do it or that I forgot how to do it.) Case 3. There exists $g \in G$ such that $f(2g) = 4 f(g) \neq 0$ and $g' \in G$ such that $f(g') \neq 0$ and $f(2g') = 0$. Again, pass on to the quotient and WLOG assume that $f^{-1}(0) = \{0\}$. The corresponding solutions fall into the third category; we claim that $g$ is a generator of $G$ of order $4$, which also implies that $g' = 2g$. For convenience, let $f(g) = A \neq 0$. Since $2g' = 0$, we have $f(g + g') = f(g - g') = f(g' - g)$. On the other hand, $(f(g + g'), f(g' - g), f(2g) = 4A)$ is a Heron triple, so we necessarily have $f(g + g') = f(g' - g) = A$. Since $f(g') \neq 0$ and $(A, A, f(g')) = (f(g), f(g' - g), f(g'))$ is Heron, we get $f(g') = 4A$. Now both $(f(g' - 2g), f(g' - g), f(g)) = (f(g' - 2g), A, A)$ and $(f(g' - 2g), f(g'), f(2g)) = (f(g' - 2g), 4A, 4A)$ are Heron, so either $f(g' - 2g) = 0$ or $f(g' - 2g) = 4A = 16A$. Since $char(R) \neq 2, 3$, the latter yields $A = 0$; a contradiction. Thus $f(g' - 2g) = 0 \implies g' = 2g$, and so $4g = 2g' = 0$. Fix any $x \in G$; the goal is to show that $x \in \{0, g, 2g, -g\}$. By (1), we get either $f(x + 2g) = f(x)$ or $f(x + 2g) + f(x) = 2 f(x + g) + 2 f(g)$. Similarly, either $f(x + 2g) = f(x)$ or $f(x + 2g) + f(x) = 2 f(x - g) + 2 f(g)$ holds, so we have either $f(x + 2g) = f(x)$ or $2 f(x + g) + 2 f(g) = 2 f(x - g) + 2 f(g) \implies f(x + g) = f(x - g)$. It now suffices to show that for any $x \in G$, $f(x + g) = f(x - g)$ implies $x \in \{0, 2g\}$; then we can apply the result to either $x$ or $x + g$. Fix any $x \in G$ such that $f(x + g) = f(x - g)$. Since $(f(x + g), f(x - g), f(2g)) = (f(x + g), f(x + g), 4A)$ is Heron and $A \neq 0$, we get $f(x + g) = A = f(g)$. Then we get $f(x + 2g), f(x) \in \{0, 4A\}$. If $f(x + 2g) = f(x) = 4A = f(2g)$, then $(4A, 4A, 4A)$ is a Heron triple; a contradiction, since $4A \neq 0$. So either $f(x + 2g) = 0 \implies x + 2g = 0 \implies x = 2g$, or $f(x) = 0 \implies x = 0$.
28.01.2024 18:33
Writing this up again I forgot my solution anyway: The only solutions are $f\equiv 0$, $f(x) = cx^2$, $f(x) = \begin{cases} 0 & x\equiv 0\pmod 2 \\ c & x\equiv 1\pmod 2 \\ \end{cases}$, and $f(x) = \frac{n + |n|}{2} \cdot c$, for any integer constant $c\ne 0$, where $x_4$ is the remainder when $x$ is divided by $4$ and $n = \nu_2( 2^{x_4} + x_4^3 + x_4^2 + 8 x_4 ) - 1$. We can check that these work, now we prove they are the only solutions. Let $P(a,b,c)$ be the given assertion. $P(0,0,0): f(0) = 0$. Claim: If $a + b + c = 0$ and $f(c) = 0$, then $f(a) = f(b)$. Proof: We have $f(a)^2 + f(b)^2 = 2f(a)f(b)$, so $(f(a) - f(b))^2 = 0\implies f(a) = f(b)$. $\square$ This implies that $f$ is even. $P(a, a, -2a): 2f(a)^2 + f(2a)^2 = 2f(a)^2 + 4f(a)f(2a)$, so either $f(2a) = 0$ or $f(2a) = 4f(a)$ for each $a$. The equation implies that \[ f(a) ^2 + f(b)^2 + f(a+b)^2 = 2f(a)f(b) + 2f(b) f(a+b) + 2f(a+b)f(a) ,\]so \[ f(a+b)^2 - (2(f(a) + f(b))) f(a+b) + (f(a) - f(b))^2 = 0, \]so using the quadratic formula, \[f(a+b) = \frac{ 2f(a) + 2f(b) \pm \sqrt{4 ( (f(a) + f(b))^2 - (f(a) - f(b))^2) }}{2} = \frac{2f(a) + 2f(b) \pm 4\sqrt{f(a)f(b)}}{2}\] This can be simplified to $f(a) + f(b) \pm 2\sqrt{f(a)f(b)} = \left(\sqrt{f(a)} \pm \sqrt{f(b)}\right)^2$. Let $Q(a,b)$ denote the assertion that \[ f(a+b) = \left(\sqrt{f(a)} \pm \sqrt{f(b)}\right)^2\] Note that if $f(x) = 0$ for some $x$, then $f(a + x) = f(a)$ by $P(a,x)$, so $f(a) = f( a\pmod x )$ (in fact implying that $f(kx) = 0$ for any integer $k$). Thus if $f(1) =0$, then $f\equiv 0$. So assume $f(1) = c \ne 0$. Now if $f(2) = 0$, we see that $f(2x) = 0$ for any integer $x$, and $f(2x+ 1) = c$ due to $f$ being periodic with period $2$ (from $P(a,2)$). This corresponds to one of the solutions described in the beginning. Now we may assume $f(2) \ne 0$, so $f(2) = 4c$. If $f(4) = 0$, then $f(4x) = 0$ for any integer $x$, so $f$ is periodic with period $4$. Since $-1 \equiv 3 \pmod 4$ and $f$ is even, we have $f(1\pmod 4) = f(3\pmod 4 )= c$ and $f(2\pmod 4) = 4c$, corresponding to one of the solutions in the beginning. Now assume $f(1), f(2), f(4)$ are nonzero. We have $f(1) = c, f(2) = 4c, f(4) = 16c$. From $P(2, 1)$, we see that $f(3)$ is either $\left(\sqrt{c} + 2\sqrt{c}\right)^2 = 9c$ or $(\sqrt{c} - 2\sqrt{c})^2 = c$. If $f(3) = c$, from $P(3,1)$, we see that $16c = \left(\sqrt{c} \pm \sqrt{c}\right)^2$, but this means $c = 0$, absurd. Thus, $f(3) = 9c$. Now we induct to show $f(n) = n^2 c $ for any positive integer $n$, with base cases $1,2,3,4$. Suppose it's true for $1,2,\ldots, n$ and $n\ge 4$. We have from $P(n,1)$ that $f(n+1) = \left( (n \pm 1) \sqrt{c} \right)^2 = (n \pm 1)^2 c $. If $f(n+1) = (n-1)^2 c $, then $P(n-1,2)$ gives that $f(n +1) = \left( (n-1) \sqrt{c} \pm 2 \sqrt{c} \right)^2$, which is either $(n-3)^2 c$ or $(n+1)^2 c$, but this means that $(n-1)^2 = (n-3)^2$ or $(n+1)^2 = (n+3)^2$, both are false for $n > 2$. Thus, we must have $f(n+1) = (n+1)^2 c$, and the induction is complete. Then of course $f(n) = n^2 c $ for any integer $n$ because $f$ is even.
12.02.2024 18:00
Let $P(x,y,z)$ be the assertion. $P(0,0,0) \implies f(0) = 0$. Let $b = 0$ to get \[f(a)^2+f(-a)^2 = 2f(a)f(-a) \implies (f(a)-f(-a))^2 = 0 \implies f(a) = f(-a)\]for all integers $a$. Next letting $c = -(a+b)$ gives \[f(a+b)^2 - 2(f(a)+f(b))f(a+b) + (f(a)-f(b))^2 = 0\]\[\implies f(a+b) = f(a)+f(b) \pm 2\sqrt{f(a)f(b)}\]Thus either all $f(x) \ge 0$ or all $\le 0$ or else there will be an complex output of $f$. Since there is a bijection between all positive $f(x)$ and negative, WLOG all $f(x) \ge 0$. Thus \[\sqrt{f(a+b)} = \left(\sqrt{f(a)}\pm \sqrt{f(b)}\right)^2 \implies g(a+b) = g(a) \pm g(b)\]where $g(x) = \sqrt{f(x)}$. Note that $g(2) = g(1) \pm g(1)$. If $g(2) = 0$, then we can inductively show $g(2k) = 0$ for all integer $k$. Next notice $g(2k+1) = g(2k) \pm g(1) = g(1)$ where we took $+$ sign to avoid $g(2k)$ being negative. If $g(2) = 2g(1)$. Next if $g(4) = 0$, then $g(4k) = 0$ for all integer $k$. Next $g(4k+1) = g(4k) \pm g(1) = g(1)$. Similarly, $g(4k+2) = 2g(1)$. Lastly since $0 = g(1) \pm g(4k+3)$, so $g(4k+3) = g(1)$. If $g(4) = 4g(1)$, then $g(3) = 3g(1)$. Next since $g(5) = 4g(1) \pm g(1) = 3g(1) \pm 2g(1)$, we must have $g(5) = 5g(1)$. Induction gives $g(n) = n g(1)$. Concluding, we see $f(x) = 0$ for even $x$, and $f(x) = c$ for odd $x$. $f(x) = 0$ for $x \equiv 0 \pmod 4$, $f(x) = c$ for $x \equiv 1,3 \pmod 4$, and $f(x) = 4c$ if $x \equiv 2 \pmod 4$. $f(x) = cx^2$ for all $x$. for any $c \in \mathbb{Z}$.
04.03.2024 05:34
07.05.2024 22:45
We claim the only functions are $\boxed{f(x)\equiv cx^2}$, \[ \boxed{f(x)\equiv \begin{cases} 0 & \text{if $x\equiv 0\pmod 2$}\\ c & \text{if $x\equiv 1\pmod 2$} \end{cases} }, \]and \[ \boxed{f(x)\equiv \begin{cases} 0 & \text{if $x\equiv 0\pmod 4$}\\ c & \text{if $x\equiv 1\pmod 2$}\\ 4c & \text{if $x\equiv 2\pmod 4$} \end{cases} } \]for a constant $c\in\mathbb{Z}$. It is not hard to check that these work. Let $P(a,b,c)$ denote the given assertion. From $P(0,0,0)$ we get $f(0)=0$ and $P(a,-a,0)$ gives us $f(a)=f(-a)$. Then $P(a,b,-a-b)$ yields \[ f(a)^2+f(b)^2+f(a+b)^2=2f(a)f(b)+2f(a+b)(f(a)+f(b)) \]so \[ f(a+b)=f(a)+f(b)\pm\sqrt{2f(a)f(b)}\tag{*} \]for all $a,b\in\mathbb{Z}$. Since $f(a+1)$ is real, it follows that $f(a)$ and $f(1)$ have the same sign. If $f(1)$ is negative we can multiply $(*)$ by $-1$ so $-f$ is positive and we can simply let $c$ be negative in our boxed functions. Thus we may WLOG assume $f(1)\geq 0$. Then $\sqrt{f(a+b)}=\left|\sqrt{f(a)}\pm\sqrt{f(b)}\right|$. Let $g(x):=\sqrt{f(x)}$ so $g(a+b)=|g(a)\pm g(b)|$ for all $a,b\in\mathbb{Z}$. Note that $g(n)=g(-n)\geq 0$ for all $n\in\mathbb{Z}$. Let $r:=g(1)$. Then $g(2)\in\{0,2r\}$. Case 1: $g(2)=0$. We prove by induction on $|x|$ that \[ g(x)\equiv \begin{cases} 0 & \text{if $x\equiv 0\pmod 2$}\\ r & \text{if $x\equiv 1\pmod 2$} \end{cases} \]with the base cases trivial. Assume the statement for $|x|\leq k$ (with $k\geq 2$). Then $g(k+1)=|g(k-1)\pm g(2)|=g(k-1)$ so the induction step is complete. This yields the second solution set with $c:=r^2$. Case 2: $g(2)=2r$. Then $g(3)\in\{r,3r\}$. Case 2.1: $g(3)=r$. We prove by induction on $|x|$ that \[ g(x)\equiv \begin{cases} 0 & \text{if $x\equiv 0\pmod 4$}\\ r & \text{if $x\equiv 1\pmod 2$}\\ 2r & \text{if $x\equiv 2\pmod 4$} \end{cases} \]with the base cases trivial. Note that $g(4)=|g(3)\pm g(1)|\in\{0,2r\}$ and $g(4)=|g(2)\pm g(2)|\in\{0,4r\}$ so $g(4)=0$. Assume the statement for $|x|\leq k$ (with $k\geq 4$). Then $g(k+1)=|g(k-3)\pm g(4)|=g(k-3)$ so the induction step is complete. This yields the third solution set with $c:=r^2$. Case 2.2: $g(3)=3r$. We prove by induction on $|x|$ that $g(x)\equiv rx$ with the base cases trivial. Assume the statement for $|x|\leq k$ (with $k\geq 3$). Then $g(k+1)=|g(k)\pm g(1)|=\{c(k-1),c(k+1)\}$ and $g(k+1)=|g(k-1)\pm g(2)|=\{r(k-3),r(k+1)\}$ so $g(k+1)=r(k+1)$. This yields the first solution set with $c:=r^2$. We are done. $\square$
07.09.2024 08:59
I claim the solution set is given by $f = kx^2$, $f = 0$, $f$ giving distinct values mod $2$, and lastly $f$ giving values mod $4$, where it gives $0$ for $0$, $k$ for $1$, $4k$ for $2$, $k$ for $3$. We check each of these work. For the first function, we desire to prove $a^4 + b^4 + c^4 = 2a^2b^2 + 2b^2c^2 + 2a^2c^2$, setting $c= -(a + b)$ and raw expansion finishes. The second function is obvious. The third function just requires us to analyze the summation cases mod $2$, of which there are only two, $0 + 0 + 0 =0$ and $0 + 1 + 1 = 0$, both of which obviously work. The last function requires us to analyze the summation cases mod $4$, of which there are just three, $0 + 0 + 0 = 0, 0 + 1 + 3 = 0, 0 + 2 + 2 = 0$, all of which obviously work. Set $a,b,c = 0$ to get $f(0) = 0$. Then set $a = -b, c = 0$ to get $f(a) = f(-a)$. We use this without mention, effectively restraining the problem over positive values. Now take $a = b, c = -2a$, and we get $2f(a)^2 + f(-2a)^2 = 2f(a)^2 + 4f(a)f(-2a)$, giving $f(-2a)^2 = 4f(a)f(-2a)$, or $f(2a)(f(2a) - 4f(a)) = 0$. Thus for all $a$, we have $f(2a) = 0$ OR $f(2a) = 4f(a)$. We now divide into two cases. Case 1: $f(n) = 0$ for some positive $n$. We first inductively prove $f(kn )= 0$ for all $k$. The case of $k = 2$ is obvious. Then take $a = n, b = kn, c = -kn - n$, we get $f(kn + n)^2 = 0$ as desired. Now we take $n | x + y$, setting $a = x ,b = y, c = -n$ gives $f(x)^2 + f(y)^2 = 2f(x)f(y)$, giving $f(x) = f(y)$. This means that if $x \equiv -y \mod n, f(x) = f(y)$ (this also implies that $f$ operates modulo $n$). Now we take the smallest positive root of $f$, $n$, and we claim that all other roots are multiples of $n$. Assume this is not the case, then there must be another root $m$ not divisible by $n$ , and $f(n - (m \mod n))$ must be equal to $f(m)$ and thus equal to $0$, forcing a smaller multiple, contradiction. It suffices now to do casework on $n$. If $n = 1$, we get $f$ is just $0$ over its entire domain. If $n$ has an odd prime divisor, we can find some solution with $k > 0, n \nmid x$ to $2^k x \equiv x \mod n$, which gives $f(2^kx) = 4f(2^{k - 1}x) = \cdots = 2^{2k}f(x)$, but since $f$ operates modulo $n$, we must have $f(x) = 2^{2k}f(x)$, which has no solutions since $f(x) \neq 0$. If $n = 2$, the only possible solution is $f$ has some value over odds and another over evens, which always works. If $n = 4$, we must have $f(1) = f(3), f(2) \neq 0$, the latter of which forces $f(2) = 4f(1)$. This constrains the solution to a mod $4$ repetition of $f(0) = 0, f(1) = k, f(2) = 4k, f(3) = k$, which always works. If $n \ge 8$, we have $f(\frac n2) > 0$, so $\frac 14(n^2)f(3) = \frac{1}{16}n^2f(6) = \cdots f(\frac n2) = \cdots = \frac{1}{16}n^2 f(2) = \frac 14 n^2 f(1)$, so $f(1) = f(3)$, then taking $a = 1, b = 3, c= -4$, gives $f(4) = 4f(1)$, contradiction. Case 2: $f(n) \neq 0$ for all positive $n$. In this case take $f(1) = k$, now we inductively prove $f(n) = cn^2$ for positive integers, then using $f$ even finishes. The base case of $n = 1,2$ are trivial. After this, take $a = 1, b = n, c= -n - 1$, this gives $c^2 + c^2n^4 + f(n + 1)^2 = 2c^2n^2 + (2cn^2 + 2c)f(n + 1)$, which gives $f(n + 1) = c(n + 1)^2, c(n - 1)^2$. If the latter is true, substitute $a = n , b =n , c = -2n$, we then get $f(2n) = 4f(n) = 4cn^2$, but substituting $a = n - 1, b = n+ 1 , c = -2n$ gives $f(2n) = 4f(n - 1) = 4c(n - 1)^2$, contradiction. This forces $f(n + 1) = c(n + 1)^2$.
12.09.2024 15:17
Let $P(a,b,c)$ denote the given assertion. Then, \begin{align*} P(0,0,0) & \ \Rightarrow 3f(0)^2=6f(0)^2 \Rightarrow f(0)=0 \\ P(a,-a,0) & \ \Rightarrow (f(a)-f(-a))^2=0 \Rightarrow f(a)=f(-a). \end{align*}So $f$ is even, we'll use this fact a lot now. If $f(1)=0$ then $P(n+1,n,-1)$ gives us $f(n+1)=f(n)$ for all $n$ so by induction $f(n)=0$. This clearly works. Let us now assume $f(1)$ is not $0$, then by scaling lets assume $f(1)=1$. $P(1,1,-2)$ implies that $f(2)\in \{0,4\}$. Let us first consider $f(2)=0$ then it's easy to find $f(n+2)=f(n)$ for all $n$. So $$f (n)=\begin{cases} 0 & n\equiv 0 \pmod 2 \\ 1 & n\equiv 1 \pmod 2\end{cases}.$$It's not too hard to verify by casework that this is indeed a solution. Let's consider $f(2)=4$. Suppose $f(n)=n^2$ for all $0 \leq n\leq k$ for $k\geq 2$. Then $$P(k,1,-k-1) \Rightarrow f(k+1)^2-2f(k+1)(k^2+1)+(k^2-1)^2=0 \Rightarrow f(k+1)=(k\pm 1)^2.$$Suppose it were that $f(k+1)=(k- 1)^2$. Then $f(k-1)=f(k+1)$ and \begin{align*} P(k+1,k-1,-2k) & \ \Rightarrow f(2k)^2=4f(2k)f(k+1) \\ P(k,k,-2k) & \ \Rightarrow f(2k)^2=4f(2k)f(k) \end{align*}This implies $f(2k)=0$. So, $P(n,2k,-n-2k)$ gives us $f(n+2k)=f(n)$. We have $$P(k-1,k-1,-2k+2)\Rightarrow 2(k-1)^4+2^4=4(k-1)^2\cdot 2^2+2\cdot (k-1)^2\cdot (k-1)^2 \Rightarrow k=0,2 \qquad (\star)$$so $k=2$. So, $f(n+4)=f(n)$ and by induction we get $$f (n)=\begin{cases} 0 & n\equiv 0 \pmod 4 \\ 1 & n\equiv 1,3 \pmod 4 \\ 4 & n\equiv 2 \pmod 4\end{cases}.$$Again, it's not too hard to verify by casework that this is indeed a solution. Now if $f(k+1)=(k+1)^2$ then by induction $f(n)=n^2$ for all $n$, which clearly works. Note that the induction works because $k+1>2$ - look at $ (\star)$.
21.12.2024 18:03
Pretty nasty casework. Note that, \[P(0,0,0)\implies 3f(0)^2=6f(0)^2\]which gives us that $f(0)=0$. Now, $P(a,-a,-0)$ gives us that \begin{align*} f(a)^2+f(-a)^2 &= 2f(a)f(-a)\\ f(a)^2-2f(a)f(-a)+f(-a)^2 &= 0\\ (f(a)-f(-a))^2 &= 0 \end{align*}Thus, $f(-a)=f(a)$ for all $a \in \mathbb{Z}^+$. Now, look at $P(a,b,-a-b)$ to obtain that, \[f(a)^2+f(b)^2+f(-a-b)^2 =2f(a)f(b)+2f(b)f(-a-b)+2f(-a-b)f(a)\]So, \begin{align*} f(a+b)^2-2f(a+b)(f(a)+f(b))+f(a)^2-2f(a)f(b)+f(b)^2&=0 \\ (f(a+b)^2-f(a)-f(b))^2 &= 4f(a)f(b) \end{align*} Now, note that, this means, \[(f(2)-2f(1))^2=4f(1)^2\]and thus, $f(2)=4f(1)$ or $f(2)=0$. Based on these two value, we have several cases. Case 1 : $f(1)=c$ and $f(2)=4c$. In this case note that we have, \[(f(3)-f(2)-f(1))^2=4f(2)f(1)=16f(1)^2\]so, $f(3)=9c$ or $f(3)=c$. So, we have two sub cases. \textbf{Subcase 1 : } $f(3)=9c$. Here, simply note that if we have $f(1)=c,\dots, f(n)=n^2c$ for some $n\geq 3$ then, \begin{align*} (f(n+1)-f(n)-f(1))^2 &= 4f(n)f(1)\\ (f(n+1)-n^2c-c)^2 &= 4n^2c^2 \end{align*}So, $f(n+1)=(n-1)^2c$ or $f(n+1)=(n+2)^2c$. But if $f(n+1)=(n-1)^2c$, \begin{align*} (f(n+1)-f(n-1)+f(2))^2 &= 4f(n-1)f(2)\\ (f(n+1)-(n-1)^2c+4c)^2 &= 16(n-1)^2c^2\\ 16c^2 &= 16(n-1)^2c^2 \end{align*}which is clearly impossible for all $n\geq 3$. Thus, we must have $f(n+1)=(n+1)^2c$. Thus, by the PMI, we have that for all integers $k \geq 1$, $f(k)=k^2f(1)$. This gives us the function $f(n)=n^2c$ for some constant $c$ for all positive integers $n$. Subcase 2 : $f(3)=c$. In this case note that we have, \[(f(4)-8c)^2=(f(4)-2f(2))^2=4f(2)^2=64c^2\]So, $f(4)=16c$ or $f(4)=0$. But note that if $f(4)=16c$ we have \[4c^2=4f(3)f(1)=(f(4)-f(3)-f(1))^2=(16c-c-c)^2\]so, $4c^2=196c^2$ which requires, $c=0$, which implies that $f(4)=0$ anyways. Thus, in all cases we have that $f(4)=0$. Note that then, we can obtain \begin{align*} (f(n+4)-f(n)-f(4))^2 &= 4f(n)f(4)\\ f(n+4)-f(n)-f(4) &= 0 \\ f(n+4) &= f(n) \end{align*}for all $n \geq 1$. Thus, the function is periodic with a period of $4$ giving us, \[ f(n)= \begin{cases} c & \text{if } n \equiv 1,3 \pmod{4}\\ 4c & \text{if } n \equiv 2 \pmod{4}\\ 0 & \text{if } n \equiv 0 \pmod{4} \end{cases} \]for all $n \in \mathbb{N}$ for some constant $c \in \mathbb{N}$. Case 2 : $f(2)=0$. Here, note that \begin{align*} (f(n+2)-f(n)-f(2))^2 &= 4f(n)f(2)\\ f(n+2)-f(n)-f(2) &= 0\\ f(n+2) &= f(n) \end{align*}for all $n\geq 1$. Thus, the function is periodic with a period of $2$ giving us the function, \[ f(n)= \begin{cases} c & \text{if } n \equiv 1 \pmod{2}\\ 0 & \text{if } n \equiv 0 \pmod{2} \end{cases} \]Thus, we have exhausted all cases and are done.
23.01.2025 10:45
Nice problem! Show that $f(0) = 0, f(-x) = f(x)$. Then from here, assuming $f(1) \ne 0$, show that if $f(n) = n^2f(1)$, then $f(n+1) \in \{(n-1)^2f(1), (n+1)^2f(1)\}$. From here, if $f(n+1) = (n+1)^2f(1) \forall n,$ then $f(x) = f(1)x^2$. Further note that if $f(2) = (1-1)f(1)^2 = 0$ then we get the solution $$f(x) = \begin{cases} f(1), \quad \text{ if } n \equiv 1 \pmod{2}\\ 0, \quad \text{ if } 2 \mid n. \end{cases}$$so assume otherwise. If $f(n+1) = (n-1)^2f(1)$ for some $n \in \mathbb{N}_{\ge 2}$, with $f(x) = x^2f(1) \forall x \le n$, comparing the equations of $(2, n-1, a)$ and $(0, n+1,a)$ gives us $f(2)^2 = 4f(2)(n-1)^2f(1)$, or $f(2) \in \{0, 4(n-1)^2f(1)\}$. $f(2) \ne 0$, so $f(2) = 4(n-1)^2f(1)$. But $4f(1) = f(2) = 4(n-1)^2f(1) \implies n \in \{0, 2\}$. $n = 0$ is false as $n \in \mathbb{N}_{\ge 2}$. So consider $n = 2$. This is basically the same as $f(3) = f(1)$. Further we may assume $f(2) = 4f(1)$ as previous. Then $f(4) = f(2\times 2) \in \{0, 16f(1)\},$ and $f(4) = f(3+1) \in \{0, 4f(1)\}$. Since $f(1) \ne 0$, this implies $f(4) = 0$. In particular, $f$ is periodic with period 4, so we get $$f(x) = \begin{cases} 0, \quad \text{ if } 4 \mid n.\\ f(1) \quad \text{ if } n \equiv 1 \pmod{2}.\\ 4f(1) \quad \text{ if } n \equiv 2 \pmod{4}. \end{cases}$$All of the functions extracted above work, so we're done. $\square$