For $1\le c\le p-1$, let $E_1,E_2,\dots ,E_m$ be fixed numbers of the set $\{0,1\}$, and let $a_1, a_2,\dots , a_m$ $(1\le a_i\le p$, $i=1,2,\dots , m)$ be of opposite parity with $E_1,E_2,\dots ,E_m$ respectively such that $a_1a_2\dots a_m\equiv c\pmod p$. Let \begin {equation*} N(c,m,p)=\frac {1}{2^{m-1}}\mathop {\mathop {\sum }_{a_1=1}^{p-1} \mathop {\sum }_{a_2=1}^{p-1}\dots \mathop {\sum }_{a_m=1}^{p-1}} _{a_1a_2\dots a_m\equiv c\pmod p} (1-(-1)^{a_1+E_1})(1-(-1)^{a_2+E_2})\dots (1-(-1)^{a_m+E_m}). \end {equation*} \endgraf We are interested in the mean value of the sums \begin {equation*} \sum _{c=1}^{p-1}E^2(c,m,p), \end {equation*} where $ E(c,m,p)=N(c,m,p)-({(p-1)^{m-1}})/({2^{m-1}})$ for the odd prime $p$ and any integers $m\ge 2$. When $m=2$, $c=1$, it is the Lehmer problem. In this paper, we generalize the Lehmer problem and use analytic method to give an interesting asymptotic formula of the generalized Lehmer problem.