Find all pairs of positive integers $(n,k)$ for which the number $m=1^{2k+1}+2^{2k+1}+\cdots+n^{2k+1}$ is divisible by $n+2.$
Source: Moldova TST 2023
Tags: number theory
Find all pairs of positive integers $(n,k)$ for which the number $m=1^{2k+1}+2^{2k+1}+\cdots+n^{2k+1}$ is divisible by $n+2.$