Problem:
Let denote the natural numbers. Compute the number of functions such that
for all integers .
, 2017
Solution
Solution:
By plugging in , we get that can be either . As is unrelated to all other values, we need to remember to multiply our answer by at the end. Similarly, or .
Consider the graph . It is a binary tree rooted at , and there is an edge , and a loop . Our first case is . Note that if satisfy , then . Otherwise, we would have , a contradiction as is a nonresidue. So only the leaves can take the value . This contributes .
For , we can once again propagate down the tree. While it looks like we have choices at each node (for the square roots), this is wrong, as if and , then is forced.
Given this intuition, let denote the answer for a binary tree of height where the top is either or . Therefore, , . You can show the recurrence . This is because if the top is , then we get a contribution of . If the top is , then both entries below it must be . After that, you can show that each of the remaining vertices can be either of possible square roots. Therefore, we get the recurrence as claimed. One can compute that , so we get the final answer .