Given a complex number $z$ and a positive integer $n$, I would like to be able to find integer solutions $\alpha,\beta,\gamma$ to the Diophantine equation $$0 < a^2\vert z \vert^2 + \beta\textrm{ Re}(z) + \gamma^2 \leq n.$$ As an example, I tried

z := 2 + 3*i
Solve[0 < a^2*Norm[z^2] + b*Re[z] + c^2 <= 100,{a,b,c},Integers]

But when I hit return+shift I got "This system cannot be solved with the methods available to Solve". Can anyone explain why this doesn't work and offer a method which will work? Thanks.

  • 1
    $\begingroup$ You have a couple of errors there. For one thing, Mma uses I not i. $\endgroup$ – bobbym Jan 31 '17 at 1:54

See if this is what you want:

z = 2 + 3*I;
rul = FindInstance[0 < a^2*Norm[z^2] + b*Re[z] + c^2 <= 100, {a, b, c}, Integers, 5]

Change the 5 for more or less.

Check the answers:

0 < a^2*Norm[z^2] + b*Re[z] + c^2 <= 100 /. rul

To store the answers:

a^2*Norm[z^2] + b*Re[z] + c^2 /. rul
  • $\begingroup$ Great, thanks. Is there a way to take the solutions $(a,b,c)$ and plug them back into the equation to obtain and store the values of $a^2\vert z \vert^2 + b\textrm{ b}(z) + c^2 $ at those points? $\endgroup$ – Ethan Alwaise Jan 31 '17 at 3:54
  • $\begingroup$ I have added it to the answer. $\endgroup$ – bobbym Jan 31 '17 at 4:10
  • $\begingroup$ Is there a way to directly list out the finitely many real numbers $x \in (0,n]$ such that $$x = a^2\vert z \vert^2 + b\textrm{Re}(z) + c^2$$ for some integers $a,b,c$? It appears that there are infinitely many solutions to the Diophantine equation I posted, but only finitely many such $x$. $\endgroup$ – Ethan Alwaise Feb 1 '17 at 2:00
  • $\begingroup$ The x you have there is what is inside of FindInstance. If there are a finite number of real x (which I doubt) then it is a large number. $\endgroup$ – bobbym Feb 1 '17 at 2:31
  • $\begingroup$ There must be a finite number because the set of such points $x$ is a lattice in a bounded region. $\endgroup$ – Ethan Alwaise Feb 1 '17 at 3:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.