6

Consider the following Diophantine equation $$x^2 + xy + y^2 = n\,.$$ For a particular positive integer $n$, the number of solutions $\left(x,y\right)$ such that $x$ and $y$ are integers is given by the function $S(n)$.

The function $S(n)$ is not one-to-one. For example, each number $n$ in the set $$\{1, 4, 9, 16, 25, 36\}$$ corresponds with $S(n) = 6$.

In increasing order, starting from $n = 1$, the first $n$ such that $S(n) = 36$ is $637$.

What is the $500$th $n$ such that $S(n) = 36$?

Any precise approach or hint from where I should start the problem?

Jyrki Lahtonen
  • 140,891

1 Answers1

0

The function $S$ corresponds to OEIS sequence A004016. From there you can get several implementations, for example in PARI:

 {a(n) = if( n<1, n==0, 6 * sumdiv( n, d, (d%3==1) - (d%3==2)))}; /* Michael Somos, May 20 2005 */
 k=0; for (n=1, oo, if (a(n)==36, print (k++ " " n); if (k==500, break)))