30
$\begingroup$

I asked this question in MathStackExchange back in April, and it received more than 30 upvotes, but no answer was offered even after a bounty. I am reposting it here in hopes that someone can answer it.

Problem. Does there exist a two-variable polynomial $P(x, y)$ with integer coefficients such that a positive integer $n$ is not a perfect square if and only if there is a pair $(x, y)$ of positive integers such that $P(x, y)=n$?

Context. The answer is positive for polynomials in 3 variables! This appeared as a problem in USA Team Selection Test in 2013. It turns out that the polynomial $P(x, y, z)=z^2\cdot (x^2-zy^2-1)^2+z$ enjoys the following property: a positive integer $n$ is a not a perfect square if and only if $P(x, y, z)=n$ has a solution in positive integers $(x, y, z)\in \mathbb{N}^{3}$. This construction works nicely due to Pell's equation. If $n$ is not a perfect square, then Pell's equation $x^2-ny^2=1$ has a solution in positive integers $(x_0, y_0)$, and so we get $P(x_0, y_0, n) = n$. Conversely, if $P(x, y, z)=n$, then one can show that $n$ cannot be a perfect square because $n=z^2(x^2-zy^2-1)^2+z$ can be squeezed between two consecutive perfect squares: $$ (z(x^2-zy^2-1))^2 < n < (z(|x^2-zy^2-1|+1)^2 $$

Remark. It is clear that there is no single-variable polynomial $P(x)$ which could achieve the desired property. Indeed, there are arbitrary number of consecutive non-squares, and a polynomial $P(x)$ of degree $n>1$ cannot output a consecutive list of $n+1$ numbers. This last claim itself is a nice problem; for a solution, see Example 2.24 in page 11 of Number Theory: Concepts and Problems by Andreescu, Dospinescu and Mushkarov.

$\endgroup$
4
  • 14
    $\begingroup$ Notice that $(x+y-1)(x+y)/2+y$ detects all non-triangular numbers. $\endgroup$ Commented Oct 21, 2022 at 7:56
  • 14
    $\begingroup$ Along similar lines to @IlyaBogdanov's comment, $P(x, y) = \frac{(x+y)^2 + 2(x-y) + 1}4$ detects non-squares, but doesn't meet the requirement of integral coefficients. $\endgroup$ Commented Oct 21, 2022 at 11:19
  • 1
    $\begingroup$ @IlyaBogdanov, I suspect you are aware of the problem, but the people who upvoted your comment may not be. The same construction would give $Q(x, y) = \frac{-(x+y)^3 + 267(x+y)^2 + 1161(x+y) + 12960x - 7907}{12960}$ but because the spacing of the antidiagonals is no longer consistent we run into the occasional integer value in the gaps, and so it does represent some cubes. $\endgroup$ Commented Oct 21, 2022 at 21:14
  • 2
    $\begingroup$ For 3 variables the theory of Pell's equation is a huge overkill: $(x+y+z-1)^2-(4x+2y-4)$ works just as nicely. $\endgroup$
    – fedja
    Commented Jan 28, 2023 at 1:27

1 Answer 1

3
$\begingroup$

This is just a long comment that might be helpful:

Treat $a$ as a parameter, and treat $x$ as a variable. The Diophantine expression $$ \exists x\ ((x^2<a) \land (a<(x+1)^2)) $$ defines $a$ as a nonsquare. Adding two more variables, we can remove the inequalities. To that end, let $$ D(a,x,y,z):=(x^2+y-a)^2+(a+z-(x+1)^2)^2. $$ Then $a$ is a nonsquare exactly when there are positive integers $x,y,z$ such that $D(a,x,y,z)=0$. Now, for the new polynomial $$ E(w,x,y,z):=w(1-D(w,x,y,z)^2), $$ its positive outputs (on positive inputs) are exactly the positive nonsquares (although there are possibly nonpositive outputs).

We can reduce the number of variables needed to define $D$ from three to two by using an idea of Carl Schildkraut (taken from a comment to the MSE version of the question). Use $$ D(a,x,y):=((x+y-1)^2+x-a)\cdot ((x+y-1)^2+(x+y-1)+x-a) $$ instead. There is a corresponding $3$-variable $E$.

To answer the question fully it would suffice to find a $1$-variable version of $D$. The hope here is that we could somehow translate Peter Taylor's near miss to this situation, where fractional considerations become less relevant.

$\endgroup$
2
  • 2
    $\begingroup$ It should be noted that the almost-answer I proposed in comments evaluates to non-integers when $x+y$ is even, so removing the fractional component could cause new problems. $\endgroup$ Commented Oct 21, 2022 at 21:48
  • 1
    $\begingroup$ A direct approach along these lines would be to target $(x^2 + y)[1 \le y \le 2x]$ as $(x^2 + y)[1 \le y,z][y+z = 2x + 1]$ giving $$E(x,y,z) = (x^2 + y)(1 - (2x-y-z+1)^2)$$ I'm not sure that it makes it easier to eliminate the third variable, though. $\endgroup$ Commented Oct 21, 2022 at 22:22

You must log in to answer this question.

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