Find all functions such that
for all .
Solutions — 2
Solution 1
Part I. Let us first check that each of the functions above really satisfies the given functional equation. If for all , then we have
If for and otherwise, then we have the same identity for and
otherwise. The same applies to the third solution (with ), where in addition one has
Part II. It remains to prove that these are really the only functions that satisfy our functional equation. We do so in three steps:
Step 1: We prove that for .
Consider the sequence () given by for . Setting in (1), we get
Of course, by definition. Since is odd, has to be odd as well, so we set for some . Then and consequently
Since , so the difference between and is at least the distance from to the nearest even square (since and are both even). This implies that
(for and , the estimate is trivial, but this does not matter). Therefore, we have
If , then
a contradiction. Thus . Checking all possible remaining values of , we find that is only a square in three cases: and . Let us now distinguish these three cases:
- , thus and . For each , we have
and the sign needs to be chosen in such a way that is again a square. This yields . At this point we have reached a contradiction, since and at the same time .
- , thus and . Then , so . This, however, is a contradiction again, since it gives us and at the same time .
- , thus and . We prove by induction that for all in this case, which we already know for now. For the induction step, assume that and . Then
so . If , then
The latter can only be a square if (since 1 and 9 are the only two squares whose difference is 8 ). Then, however, and , so
but neither 32 nor 40 is a perfect square. Thus , which completes our induction. This also means that for all .
Step 2: We prove that either , or and for .
Set in (1) to get
This means that . If , then for all , since we would otherwise have
If , then we know that from the first step, so
which yields .
Step 3: We discuss the values of for .
Lemma. For every , we have or . Moreover, if for some , then also .
Proof. We prove this statement by strong induction on . For , we get
Thus needs to be nonnegative. If , then , so (by our second step). Otherwise, we know that , so
which yields and thus establishes the base case. For the induction step, we consider two cases:
- If , then
so (for , this case cannot even occur). If , then we already know from the first two steps that , unless perhaps if and . However, the latter would imply (as shown in Step 2) and thus , which is impossible. If , we can apply the induction hypothesis to . In either case, . Therefore,
which gives us
a contradiction.
- Thus, we are left with the case that . Now we argue as in the previous case: if , then by the first two steps, since and would imply (as seen in Step 2) and is thus impossible. If , we can apply the induction hypothesis, so in any case we can infer that . We obtain
so either
which gives us , or
Since 1 and 9 are the only perfect squares whose difference is 8 , we must have , which we have already considered.
Finally, suppose that for some . Then
so . However, we already know that or , so .
Combining everything we know, we find the solutions as stated in the answer:
- One solution is given by for all .
- If is not always equal to , then there is a largest integer (which cannot be positive) for which this is not the case. In view of the lemma that we proved, we must then have for any integer . If , we obtain for (and otherwise). If , we have the additional possibility that for negative and for positive .
Solution 2
Let us provide an alternative proof for Part II, which also proceeds in several steps.
Step 1. Let be an arbitrary integer and . We first concentrate on the case where is sufficiently large.
1. If , then (1) applied to yields , thus
From now on, we set . Throughout Step 1, we will assume that , thus .
2. From (1), noticing that and have the same parity, we get
Hence we have
For the rest of Step 1, we also assume that . Then by (3) we have and thus .
3. Set ; by (3), we have . Thus (1) yields
which implies
because . Thus (3) can be refined to
Now, from with we get , where . Since , this can happen only if , which in turn yields . To summarise,
We have shown that, with at most finitely many exceptions, . Thus it will be convenient for our second step to introduce the sets
Step 2. Now we investigate the structure of the sets , and .
4. Note that . If , then . Otherwise we have ; then the original equation (1) with gives us , so . By (4) this may happen only if , so in this case . In any case we find that .
5. Now take any . We claim that every integer also lies in . We proceed by induction on , the base case being covered by our assumption. For the induction step, assume that and plug into ( 1 ). We get , so either or .
Assume that and , since otherwise we already have . Plugging into (1), we obtain , which may happen only if and . Plugging into (1), we get , which in turn may happen only if .
Thus and at the same time , which gives us . Since this has already been excluded, we must have , which completes our induction.
6. Now we know that either (if is not bounded below), or , where is the smallest element of . In the former case, for all , which is our first solution. So we assume in the following that is bounded below and has a smallest element .
If , then we have for and for . In particular, in any case, so and thus . Thus we end up with the second solution listed in the answer. It remains to consider the case where .
7. Assume that there exists some with , so that . Then we have , so either or . In the former case we have , which is impossible by our choice of . So we get , which implies and .
If , then we have , so and therefore ; hence . But then , so , which is impossible.
If , then we have , so and . Then , so and . This implies , which contradicts our assumption that .
8. Thus we have shown that , and is finite. Take any element , and consider the sequence defined by . All elements of the sequence lie in , hence it is bounded. Choose an index for which is maximal, so that in particular and . Our functional equation (1) yields
Since and have the same parity and , this leaves us with three possibilities: , and .
If , then , which means that or , and we reach a contradiction.
If , then , thus . So either or (by maximality of for all . In the former case, we can repeat the entire argument
with in the place of . Now is not possible any more since , leaving us with the only possibility .
Thus we know now that either all are equal to 0 , or . If , then either and , or and . From this point onwards, all elements of the sequence are either 0 or .
Let be the last element of the sequence that is not equal to 0 or (if such an element exists). Then , so
which gives us a contradiction. Thus all elements of the sequence are equal to 0 or , and since the choice of was arbitrary, .
9. Finally, we show that and . Suppose that . Then in particular (the smallest element of ) cannot be less than 4 , since this would imply . So , which means that . Then , so , and we reach a contradiction.
Suppose that . The only possible values for that are left are 0 and -4 . Note that , so . If , then we get , thus . But then , which is impossible. Thus , which gives us , and this is clearly absurd.
Now we are left with and as the only possibility. If , then , so , which is another contradiction. Thus , meaning that . On the other hand, would imply , so we can only have . Thus comprises all positive integers, and comprises all negative integers. This gives us the third solution.