TITLE: The condition that Euler's prime generating polynomial is a composite number
QUESTION [9 upvotes]: I anticipate that the number of lattice points of a special ellipse will be equal to the number of divisors of a number represented by Euler's prime generating polynomial.
Euler's prime generating polynomial:
$$f(x)=x^2+x+41 \ \ \ \ \ \ \ \ x\in\mathbb{Z} $$
Special ellipse:
$$X^2+163Y^2-2(2x+1)Y-1=0 \ \ \ \ \ \ \ \ \ X,Y\in\mathbb{R}$$
$$$$
For example, let $x$ be 40.
Euler's prime generating polynomial:
\begin{eqnarray*}
    f(40)&=&40^2+40+41\\
    &=&1681\\
    &=&41^2
\end{eqnarray*}
The number of divisors of $f(40)$ is equal to 3.
Special ellipse:
\begin{eqnarray*}
   &X^2&+163Y^2-2(2\cdot40+1)Y-1=0\\
&X^2&+163Y^2-162Y-1=0
\end{eqnarray*}
Lattice points of this special ellipse are following.
$$(X,Y)=(1,0),(-1,0),(0,1)$$
The number of lattice points is equal to 3.
Please watch this video https://www.youtube.com/watch?v=i5c69-A0cEk.

If you find a counterexample or proof, please let me know.


I assert the following theorem related to this problem.

Theorem 1. $ \forall x, \alpha \in \mathbb{N}, \alpha \neq 1$,
The equation $$x=Yy^2+(Y+1)y+Y\alpha$$ has rational solution $y$ and
natural number solution $Y$ $\Rightarrow$
$x^2+x+\alpha$ is a composite number.

Proof.
We express the two rational solutions as following:
$$y=\frac{n_1}{m_1},\frac{n_2}{m_2},\ \ \ \ where \ m_i\in\mathbb{N},\ n_i\in\mathbb{Z},\ gcd(m_i,n_i)=1,\ (i=1,2)$$
From the factor theorem and $gcd(Y,Y+1)=1$, we can get the following relation.
$$(m_1y-n_1)(m_2y-n_2)=Yy^2+(Y+1)y+Y\alpha-x$$
$$m_1m_2y^2-(m_1n_2+m_2n_1)y+n_1n_2=Yy^2+(Y+1)y+Y\alpha-x$$
Hence
\begin{eqnarray*}
   m_1m_2 &=& Y \\
   -(m_1n_2+m_2n_1) &=& Y+1 \\
   n_1n_2 &=& Y\alpha-x
\end{eqnarray*}
So we can get
$$x=m_1m_2\alpha-n_1n_2$$
$$m_1n_2+m_2n_1+m_1m_2=-1.$$
We combine the two equation as following:
$$x=\frac{n_1n_2-m_1m_2\alpha}{m_1n_2+m_2n_1+m_1m_2}$$
We enter this $x$ into $x^2+x+\alpha$ and calculate the factorization.
We can get
$$x^2+x+\alpha = \frac{(n_1^2+m_1n_1+\alpha m_1^2)(n_2^2+m_2n_2+\alpha m_2^2)}{(m_1n_2+m_2n_1+m_1m_2)^2}.$$
Since $\ m_1n_2+m_2n_1+m_1m_2=-1$,
$$x^2+x+\alpha = (n_1^2+m_1n_1+\alpha m_1^2)(n_2^2+m_2n_2+\alpha m_2^2).$$
So $x^2+x+\alpha$ is a composite number.
$$\tag*{$\square$}$$

Since $y=\frac{-Y-1 \pm \sqrt{(1-4\alpha)Y^2+2(2x+1)Y+1}}{2Y}$, we can get a condition from Theorem 1.

Lemma. $\forall x,\alpha \in \mathbb{N}$,
The ellipse $$X^2 = (1-4\alpha)Y^2+2(2x+1)Y+1, \ \ \ \ \ \ Y>0$$ has
lattice points$(X,Y)$.  $\Rightarrow$ $y$ is a rational number.

If  $Y=0$ is allowed, the ellipse has always $(X,Y) = (\pm 1,0)\ \ $(trivial lattice points).
Hence, the following assertion is correct.

Theorem 2. $\forall x,\alpha \in \mathbb{N}, \alpha \neq 1$,
The ellipse has one or more non-trivial lattice points. $\Rightarrow x^2+x+\alpha$ is a composite number.

The following conjecture is unresolved.

Conjecture. $\forall x \in \mathbb{N} ,\ \forall \alpha \in \{3,5,11,17,41\} $,
The ellipse has only trivial lattice points. $\Leftrightarrow x^2+x+\alpha$ is a prime number.
(The ellipse has one or more non-trivial lattice points. $\Leftrightarrow x^2+x+\alpha$ is a composite number.)

If this conjecture is correct, the number of lattice points and the number of divisors are equal.

REPLY [2 votes]: Edit 1 (2020/01/16): This now gives an injective map from distinct factorization pairs $\{r,s\}$ to distinct lattice points $(\pm X,Y)$, hence number of divisors $\leq $ number of lattice points.

I think I've got the other direction, but right now I can only see an easy way via Algebraic Number Theory. An elementary way seems possible but it took me a full page just to show that every prime factor has the form $a^2+163b^2=4p$. It's hard to squeeze it in here. The summary is

Theorem 1. Let $x$ be an integer an $r,s$ integers satisfying
  $$
x^2+x+41 = rs
$$
  Then there exists integers $a,b,c,d$ such that
  $$
\begin{align*}
(r,s) &= \left(\frac{a^2+163b^2}{4},\frac{c^2+163d^2}{4}\right)\\
ac-163bd &= 2(2x+1)\\
ad+bc &= 2
\end{align*}
$$
  Then setting $(X,Y)=(ad-1,-bd)$ satisfies
  $$
X^2+163Y^2-2(2x+1)Y-1=0
$$


Given any integer $x$, we start with
$$
x^2+x+41 = \frac{(2x+1)^2+163(1)^2}{4} = \frac{(2x+1)+w}{2}\cdot \frac{(2x+1)-w}{2}
$$
where $w=\sqrt{-163}$. Let the prime factorization of $x^2+x+41$ be
$$
x^2+x+41 = \prod_{k=1}^n p_i
$$
where the $p_i$ may be repeated.  

Now the key idea is, using Algebraic Number Theory, there is a unique factorization (since $\mathbb Q(w)$ has class number $1$)
$$
\frac{(2x+1)+w}{2} = \pm\prod_{k=1}^n \frac{a_i+b_iw}{2}
$$
where the $a_i,b_i$ satisfies
$$
p_i = \frac{a_i^2+163b_i^2}{4}
$$

To get a pairwise factorization $x^2+x+41=rs$, for each prime factor $p$ of $r$ we can pick a corresponding $(a_i+b_iw)/2$ such that $a_i^2+163b_i^2=4p$. This splits the product into two:
$$
\begin{align*}
\frac{(2x+1)+w}{2} &= \left(\pm\prod_{i=1}^m \frac{a_i+b_iw}{2}\right)\cdot \left(\pm\prod_{i=m+1}^n \frac{a_i+b_iw}{2}\right)
\end{align*}
$$
(possibly with some rearranging of the primes.) Now taking the norm, (or complex norm):
$$
\begin{align*}
N(\frac{(2x+1)+w}{2}) &= N\left(\pm\prod_{i=1}^m \frac{a_i+b_iw}{2}\right)\cdot N\left(\pm\prod_{i=m+1}^n \frac{a_i+b_iw}{2}\right)\\
\frac{(2x+1)^2+163}{4} &= (\prod_{i=1}^m p_i) \cdot (\prod_{i=m+1}^n p_i) = r\cdot s
\end{align*}
$$

Now comes the key part: For each of those arrangements we can rewrite the factored equation as 
$$
\begin{align*}
\frac{(2x+1)+w}{2} &= \left(\pm\prod_{i=1}^m \frac{a_i+b_iw}{2}\right)\cdot \left(\pm\prod_{i=m+1}^n \frac{a_i+b_iw}{2}\right)\\
&= \frac{a+bw}{2} \cdot \frac{c+dw}{2}
\end{align*}
$$
for some integers $a,b,c,d$.  
By comparing the real and imaginary parts,
$$
\begin{align*}
ac-163bd &= 2(2x+1)\\
ad+bc &= 2
\end{align*}
$$
These are the two defining equations that gives us our lattice points:
$$
\begin{align*}
0 &= 0*a + 0*b\\
&= (ad+bc-2)*a - (ac-163bd-2(2x+1))*b\\
&= a^2d-2a +163b^2d + 2(2x+1)b\\
0 &= (ad)^2-2(ad) + 163(bd)^2+2(2x+1)(bd)\\
0 &= (ad-1)^2 + 163(-bd)^2 - 2(2x+1)(-bd) -1
\end{align*}
$$
Hence we may set
$$
(X,Y) = (ad-1,-bd)
$$
Finally, we note that each factorization has two factors and and there are two lattice points $(\pm X,Y)$ so this gives a two-to-two map.  

Note: There is still a need to show that distinct $r,s$ gives rise to distinct $(\pm X,Y)$'s. I'm not sure if it's obvious. 
Edit 1 (Map is injective): 

Lemma 2. The map in Theorem 1 maps distinct factorization pairs $(r,s), r\leq \sqrt{x^2+x+41}$ to distinct lattice points $(\pm X,Y)$. Therefore the number of divisors of $x^2+x+41$ is lesser or equal to the number of lattice points.

Proof. Consider the set of factorizations pairs $(r_i,s_i)$ (with $r_i \leq \sqrt{x^2+x+41}$). By Theorem 1, we may write each element as
$$
(r_i,s_i) = \left(\frac{a_i^2+163b_i^2}{4},\frac{c_i^2+163d_i^2}{4}\right)
$$
Now since
$$
a_id_i+b_ic_i = 2,
$$
either $\gcd(a_i,b_i)=1$ or $\gcd(c_i,d_i)=1$. If $\gcd(a_i,b_i)=2$ then we swap $(r_i,s_i)$ to $(s_i,r_i)$. This ensures $\gcd(a_i,b_i)=1$ for all pairs.  
Now we claim that the set
$$
(X,Y) = (a_id_i-1, -b_id_i)
$$
is distinct with no repetitions. Suppose otherwise, then
$$
(a_id_i-1) = X = (a_jd_j-1), -b_id_i = Y = -b_jd_j
$$
for some $i\neq j$. This gives
$$
a_i/a_j = d_j/d_i = b_i/b_j \implies a_ib_j = a_jb_i
$$
But since $\gcd(a_i,b_i) = 1 = \gcd(a_j,b_j)$, this gives 
$$
(a_i,b_i) = (a_j,b_j)
$$
which would then give $r_i =r_j$, contradicting that each $r_i$ is distinct.  
Therefore each factorization must map to a distinct (positive) lattice point $(X,Y)$.
$$
\tag*{$\square$}
$$ 

Example. We choose a random integer $x=3080456244$, giving us factorization
$$
x^2+x+41 = 53\cdot 5237\cdot 3435239\cdot 9952099
$$
Next we work out the unique factorizations $a^2+163b^2=4p$. With $w=\sqrt{-163}$, this is:
$$
\frac{(2x+1)+w}{2} = \left(\frac{7-w}{2}\right)\left(\frac{35-11w}{2}\right)\left(\frac{2977-173w}{2}\right)\left(\frac{-6273+53w}{2}\right)
$$
Now suppose we are interesting in the factorizations $r=53\cdot 9952099,s = 5237\cdot 3435239$. Hence we rewrite the equation as
$$
\begin{align*}
\frac{(2x+1)+w}{2} &= \left(\frac{7-w}{2}\frac{-6273+53w}{2}\right)\cdot \left(\frac{35-11w}{2}\frac{2977-173w}{2}\right)\\
&= \left(\frac{-17636+3322w}{2}\right)\cdot \left(\frac{-102997-19401w}{2}\right)
\end{align*}
$$
Hence we get
$$
(a,b,c,d) = (-17636,3322,-102997,-19401)
$$
and a simple check shows
$$
ac-163bd = 2(2x+1),\;\;\;\; ad+bc = 2
$$
Taking norms will give us
$$
x^2+x+41 = \frac{(-17636)^2+163(3322)^2}{4} \cdot \frac{(-102997)^2+163(-19401)^2}{4} = (r)\cdot (s)
$$
which is the correct factorization. Setting
$$
(X,Y) = (ad-1,-bc) = (342156035, 64450122)
$$
we can also check that
$$
X^2+163Y^2-2(2x+1)Y-1 = 0
$$
which is indeed a valid lattice point.