Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Call a prime $p$ awesome if there exist positive integers $x$ and $y$ such that $p^2$ divides $x^2+y^2+1$.

Observation: $2$ is not awesome, because $x^2+y^2+1\not\equiv 0$ (mod $4$). But $3$ is awesome, because $9$ divides $27=5^{2}+1^{2}+1$. So my question is:

Are there infinitely many awesome primes? Can we find all awesome primes?

Motivation: It is true that for every prime $p$, there exists positive integer $x$ and $y$ such that $p$ divides $x^2+y^2+1$. The proof can be found here. (This is actually a nice result; for example, it is used in a proof of Lagrange's $4$-square theorem).

If this is too trivial, what can we say if $p^2$ is replaced by $p^{k}$? :)

share|cite|improve this question
up vote 8 down vote accepted

Every odd prime has this property - even if you replace $p^2$ by $p^k$. (pretty awesome, huh)

Find a solution $(x_1,y_1)$ to $x_1^2+y_1^2+1\equiv0\pmod p$; without loss of generality, $p$ doesn't divide $x_1$. Consider the polynomial $x^2+(y_1^2+1)$. This polynomial has a root $x_0$ modulo $p$, and its derivative at that root is $2x_0\not\equiv0\pmod p$. Therefore, by Hensel's lemma, the polynomial $x^2+(y_1^2+1)$ has a root modulo $p^k$ for every $k$ - in fact, a unique root that is congruent modulo $p$ to $x_0$.

share|cite|improve this answer
Thank you! I think I will start calling you awesome instead :) finally I see a fruitful application of Hensel's Lemma! – Prism Mar 9 '14 at 18:52

Well time factor here is probably only 3.

Written in the ideal equation: $X^2+Y^2+1=3Z^3$

Solutions can be written using the following equation Pell. $p^2-2(k^2+k+1)s^2=1$

Then the solutions are of the form:




$k$ - what some integer.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.