I am trying to find out for what values for $x$ does the function $f(x)=32x+32$ return a square number? I found that this is the case for at least: $x \in \{64,1600,53824,1827904,62094400,2109381184\}$ but I can't see a pattern in those numbers.

Is there a formula which generates these values for $x$ instead of simply trying a lot of values?

  • $\begingroup$ I'm not sure about a formula, but didn't you miss one? If $x = 31$, then $32(31) + 32 = (32)(32)$ which is a square. $\endgroup$
    – layman
    Commented Jun 15, 2015 at 18:48
  • $\begingroup$ @randomgirl deleted her answer, but I thought it was useful. Basically she said that since $32 = 2^{5}$, then $32x + 32 = 2^{5}(x + 1)$. So if $x + 1 = 2^{2k + 1}$ for any integer $k \geq 0$, then $2^{5}(x + 1)$ will be a perfect square. But actually $x + 1$ could equal infinitely many possibilities, since we could have $x + 1 = 2a^{2}$ for any integer $a$, or $x + 1 = 2a^{2k}b^{2j}c^{2n}$ for any integers $a,b,c$ and integers $k, j, n \geq 0$ (and so on). This should at least convince you that there are infinitely many solutions. $\endgroup$
    – layman
    Commented Jun 15, 2015 at 19:10

3 Answers 3


$$32(x + 1) = y^2 \implies 32 \mid y^2 \implies 4 \mid y$$ so let $y = 4z$. $$2(x+1) = z^2 \implies 2 \mid z$$ so let $z = 2w$ $$x + 1 = 2w^2 $$ so given any $w$ we can solve for $x$.

So the set of solutions is $$\{(2w^2 - 1, 8w) \mid w \in \Bbb Z\}$$

  • $\begingroup$ @user46944 Please see my last edit. $\endgroup$
    – wlad
    Commented Jun 15, 2015 at 18:54
  • $\begingroup$ You need to exclude $w=0$, don't you? $\endgroup$
    – Clement C.
    Commented Jun 15, 2015 at 18:56
  • 1
    $\begingroup$ @ClementC. If you want. I'm listing all solutions over the integers. $\endgroup$
    – wlad
    Commented Jun 15, 2015 at 18:57
  • 1
    $\begingroup$ In fact, $32|y^2$ already implies $8|y$ the two consequtive steps aren't necessary. $\endgroup$ Commented Jun 15, 2015 at 18:59
  • 1
    $\begingroup$ @user3491648 that's not the other way around, "y is divisible by 4" and "4 divides y" mean the same thing. $\endgroup$ Commented Jun 27, 2015 at 6:37

The answer by user3491648 gives a complete characterization of the full set of values $x$ for which $32x+32$ is a square numbers. This is really just an observation on the set of values


reported by the OP.

These are not actually values that $x$ takes on. (As user3491648 finds, it requires on odd value of $x$ to make $32x+32$ a square.) Rather, these seem to be the square values that correspond to values of $x$ that are themselves squares, namely of the following values:


For example, $32\cdot239^2+32=1827904$. It's unclear why these values are being singled out, but they do seem to obey a two-term recursion, namely


For example, $1393=6\cdot239-41$.

  • $\begingroup$ Great observation! I was actually trying to find values for x where (xx)-1 mod 8 == 0 and where 32*xx+32 is a square $\endgroup$ Commented Jun 15, 2015 at 19:28

Solution for x such that 32x+32 is a square as follows: For integral solution, x= (n2 -2)/2 such that x is in Natural number.(n is in natural number)


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .