Please check my post.
It indicates that the number of divisors of $x^2+x+41$ is equal to the number of lattice points of $X^2+163Y^2-2(2x+1)Y-1=0$.
This formula is transformed in this way.
$$163X^2+163^2Y^2-2\cdot163(2x+1)Y=163$$ $$163X^2+\{163Y-(2x+1)\}^2-(2x+1)^2=163$$ $$163X^2+(163Y-2x-1)^2=4x^2+4x+164$$
$X':=163Y-2x-1,\ Y':=X$ and we divide both sides by 4,
$$\frac{{X'}^2+{163Y'}^2}{4}=x^2+x+41$$ $$N\left(\frac{X'+Y'\sqrt{-163}}{2}\right)=x^2+x+41$$
$\frac{X'+Y'\sqrt{-163}}{2}$ is a element of $\mathbb Q(\sqrt{-163})$.
This formula indicates the following: The number of elements of $\mathbb Q(\sqrt{-163})$ with norm $x^2+x+41$ is linked to the number of divisors of $x^2+x+41$.
The phenomenon you are interested in may also be based on this fact.