Let $ m$ a positive integer and $ p$ a prime number, both fixed. Define $ S$ the set of all $ m$-uple of positive integers $ \vec{v} = (v_1,v_2,\ldots,v_m)$ such that $ 1 \le v_i \le p$ for all $ 1 \le i \le m$. Define also the function $ f(\cdot): \mathbb{N}^m \to \mathbb{N}$, that associates every $ m$-upla of non negative integers $ (a_1,a_2,\ldots,a_m)$ to the integer $ \displaystyle f(a_1,a_2,\ldots,a_m) = \sum_{\vec{v} \in S} \left(\prod_{1 \le i \le m}{v_i^{a_i}} \right)$. Find all $ m$-uple of non negative integers $ (a_1,a_2,\ldots,a_m)$ such that $ p \mid f(a_1,a_2,\ldots,a_m)$. (Pierfrancesco Carlucci)
Problem
Source: Oliforum math contest, problem 4
Tags: function, modular arithmetic, number theory, number theory proposed