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

I want to show that if an integer number is a square and a cube, then it can be writen as $5n,5n+1$, or $5n+4$.

I tried the following. There are integers numbers $x,y$ such that $n=x^{2}=y^{3}.$ By using Euclidean division, then $x$ and $y$ can be writen as $5k,5k+1,5k+2,5k+3$ or $5k+4.$ If $x=5k$ and $y=5l$ we have $n=5(5k^{2})=5(5^{2}l^{3})$. If $x=5k$, then we must have $y=5l.$ I don't know what to do. Any hint?

share|cite|improve this question
Use unique factorization to see that if $n$ is both a square and a cube, then it must be a sixth power. Then show that $(5k+r)^6$ has one of those three forms for $r=0,1,2,3,4$. – Brian M. Scott May 21 '12 at 21:29
Try listing the first few squares and cubes and seeing what remainder you get when you divide by 5. That should not take long and may reveal a pattern you can prove. – Mark Bennet May 21 '12 at 21:30
The y^3 restriction is irrelevant. $0^2 \equiv 0 \pmod 5,$ then $1^2 \equiv 1 \pmod 5,$ then $2^2 \equiv 4 \pmod 5,$ then $3^2 \equiv 4 \pmod 5,$ then $4^2 \equiv 1 \pmod 5.$ Or, for instance, if $x = 5 k + 1,$ then $x^2 = 25 k^2 + 10 k + 1 = 5 (\mbox{stuff}) + 1.$ Or, if $x = 5 k + 3,$ then $x^2 = 25 k^2 + 30 k + 9 = 5 (\mbox{stuff}) + 4.$ – Will Jagy May 21 '12 at 21:34
up vote 6 down vote accepted

Already if an integer is a square it must be of the shapes you have described.

It is easiest to prove this using congruence notation. Any integer is congruent to $0$, $1$, $2$, $3$, or $4$ modulo $5$. Note now that $0^2$, $1^2$, $2^2$, $3^2$, and $4^2$ are respectively congruent to $0$, $1$, $4$, $4$, and $1$ modulo $5$, so never to $2$ or to $3$ modulo $5$.

If we do not want to use congruence notation, calculate the remainder when $(5k)^2$, $(5k+1)^2$, $(5k+2)^2$, $(5k+3)^2$, and $(5k+4)^2$ are divided by $5$. As a sample, let's do it for $(5k+3)^2$. This is $25k^2+30k+9$, which is $5(5k^2+6k+1)+4$, so it has remainder $4$ on division by $5$.

Out of curiosity, let us explore the cubes modulo $5$. Note that $0^3$, $1^3$, $2^3$, $3^3$, and $4^3$ are congruent respectively to $0$, $1$, $3$, $2$, and $4$ modulo $5$. So, unlike squares, cubes can take on any value modulo $5$.

By looking at the numbers $0$, $1$, and $64$, which are all perfect squares and perfect cubes, we can see that indeed a number which is a perfect square and a perfect cube can be of any of the shapes described.

share|cite|improve this answer

Hint $\ $ The squares mod $5$ are $\rm\:\{0,\pm1, \pm2\}^2 \equiv \{0,1,4\},\:$ so the cube condition is redundant.

share|cite|improve this answer

Very late but here's a slightly different way (similar to that of Andre's):

$$ n=a^3=b^2 $$ clearly means, a is a square of some integer and b is a cube of some (other) integer, so $$ n=x^6=(10*m+n)^6. $$ since, we are concerned only with the first digit, the sixth powers (mod 10) for the first 10 numbers: $$ 0, 1, 4, 9, 6, 5, 6, 9, 4, 1 $$ which are of the form $$ 5k, 5k+1, 5k+4 $$

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.