# Proving 7n+5 is never a cubic number?

This is from a question that starts with:

An arithmetic progression of integers an is one in which $a_n=a_0+nd$, where $a_0$ and $d$ are integers and n takes successive values $0, 1, 2, \cdots$ Prove that if one term in the progression is the cube of an integer there will be an infinite number of such terms.

I have done this part (with help) but I am now stuck on proving that $7n+5$ can never be a cubic number (i.e. $x^3$ where $x$ is an integer) and $n$ is a positive integer. My first plan was proof by induction, trying this with both $x$ (from $x^3=7n+5$) and then $n$. Nether of these worked as I got formula that seemed impossible to solve. I have also tried manipulating $x^3=7n_1+5$ and $y^3=7n_2+5$ since if $x$ is an integer then there must also be a $y$ which this statement is also true. Any hints on where to start would be great thanks!

-
Are you familiar with modular arithmetic? – Théophile Jul 12 '14 at 19:09
Seven calculations, separately cube $7n, 7n+1, 7n+2,7n+3,7n+4,7n+5,7n+6,$ and find the remainders when dividing by $7.$ – Will Jagy Jul 12 '14 at 19:11

This is quite a quick thing to prove with modular arithmetic, but I will avoid that and use first principles. Suppose $m^3 = 7n+5$. There are seven cases:

• $m=7k$
• $m=7k+1$
• $m=7k+2$
• $m=7k+3$
• $m=7k+4$
• $m=7k+5$
• $m=7k+6$

So basically, $m=7k+i$ for $i$ in $\{0,1,\ldots,6\}$.

Now \begin{align} (7k+i)^3 &= 7n+5\\ 7^3k^3+3\cdot7^2k^2i+3\cdot7ki^2+i^3&=7n+5\\ 7^3k^3+3\cdot7^2k^2i+3\cdot7ki^2&=7n+5-i^3\\ 7^3k^3+3\cdot7^2k^2i+3\cdot7ki^2-7n&=5-i^3\\ 7\left(7^2k^3+3\cdot7k^2i+3\cdot k i^2-n\right)&=5-i^3 \end{align}

And this means $7$ is a divisor of $5-i^3$. If we check what $5-i^3$ is for all seven cases, we see that this is impossible. So the original premise that $m^3 = 7n+5$ cannot be true.

-

There is an easier way if

$$x^3\equiv 5 \pmod 7$$

then $$x^6\equiv 5^2 \pmod 7$$ but $$x^6\equiv 1\pmod 7$$ so we must have

$$5^2 \equiv 1\pmod 7$$ one can see that $$5^2 \equiv 4\pmod 7$$

-
Where are you getting $x^6\equiv 1\pmod 7$, Fermat's Little Theorem? I think it's a claim worth justifying, especially considering that it's not true for $x$ divisible by $7$ :-) – Steve Jessop Jul 12 '14 at 23:05
Another interesting variant on this: we know $x^6 \equiv 1 \pmod{7}$, ignoring the case that $x$ is divisible by 7 for now, thus $x^3 \equiv \pm 1 \pmod{7}$ because $7$ is prime. But $5 \not \equiv \pm 1 \pmod{7}$. – Thomas Jul 13 '14 at 2:32

For the cube question, compute $0^3, 1^3, 2^3, 3^3, 4^3, 5^3, 6^3$ modulo $7$. The results are $0,1,1,6,1, 6, 6$, so never $5$.

Remark: There are shortcuts, for $(7-a)^3\equiv -a^3\pmod{7}$, so really we need only compute for $a=1,2,3$.

-

$7$ is a prime number. By Fermat's little theorem, for every integer $x$, we have either

$$x \equiv 0 \pmod 7\quad\text{ OR }\quad x^6 \equiv 1\pmod 7$$ This implies if $y = x^3$ is a cube, we have

$$y^2 = x^6 \equiv 0 \text{ or } \pm 1 \pmod 7$$

Since $5 \not\equiv 0 \text{ or } \pm 1 \pmod 7$, no numbers of the form $7n + 5$ can be a cube.

-