Let $n$ and $k$ be positive integers. A function $f$:{$1, 2, 3, 4, ... kn$} --> {$1, ... 5$} is said to be good if $f (j + k) - f (j)$ is a multiple of $k$ for all $j = 1.2, ..., kn - k$
a) Prove that if $k = 2$, then the number of good functions is a perfect square for every positive n integer.
b) Prove that if $k = 3$, then the number of functions is good a perfect cube for every positive n integer.
I tried the following:
a) After $k = 2$ I saw that $ f (j + 2) - f (j)$ is a multiple of $k = 2 $ and have the same parity
b) the number of functions of b is $8 (n-1)^3$
I think you can divide the function into three parts, naturally separate into $ k$ equal parts.
I also think it can show that it has a bijection of $ 1$ even with each part of this function closed by $ j + k$
For arbitrary $k$, the numbers in set $A_j = \{ f(k(i+1)+j)-f(ki+j) \ | \ 0 \leqslant i \leqslant n-2 , \ 1 \leqslant j \leqslant k \}$ are multiple of $k$. So we have as choices as $k$ multiples in range. Suppose we have $x$ elements in range that are multiples of $k$. So we have $x^{|A_j|} = x^{n-1}$ choices for $A_j$. Since we have $k$ number of $A_j$ that are disjoint any two of them. So we have $(x^{n-1})^k$. For last step, suppose we have $y$ elements in range at all. Now for every $A_1, \dots, A_k$ there is $y$ different choices. So we have: $$(yx^{n-1})^k$$ different choices for function $f$, that is a perfect $k$-power.
In fact this answer is a generalization for arbitrary $k$ and range set.