Given $A = \{1, 2, 3,\dots , 111\}$ and $B = \{1, 2, 3,\dots , 2021\}$. How many functions $f\colon A\to B$ with the following property $$f (x + y) = f (x) + f (y)$$ for every $x, y \in A$?
All I can think of is substituting $x = y$
$$f(2x)=2f(x)$$
After that I was confused what should I do.
Think of A on the x-axis and B on the y-axis. Then consider the (integer) lattice points. Note that the function is completely determined by $f(1)$. (Can you argue this rigorously?)
Now note that $18<2021/111<19$. So as not to “overshoot” the range, you have to have $1\le f(1)\le 18$. So there are $18$ such functions.