compute $ \operatorname{Spec}\mathbb{Z}[x,y]/(x^2+y^2-n) $ In order to study the equation $x^2 + y^2 = n$ I'd like to understand the related commutative ring
$$ R = \mathbb{Z}[x,y]/(x^2+y^2-n)$$
I'd like compute the spectrum of this ring.  What are the prime ideals?


*

*$(x-a, y-b)$ with $a^2+b^2=n$

*if $p(x,y)$ is an irreducible polynomial in $\mathbb{Z}[x,y]$ 
that is not a multiple of  $x^2 + y^2 = n$, then $(f(x,y))$ is prime in $\mathbb{Z}[x,y]/(x^2+y^2-n)$. This is like considering $(f(x,y), x^2+y^2-n)$ inside of $\mathbb{Z}[x,y]$.
Are there any others? These polynomials may correspond to generic points (also here)?

Certainly if $\mathbb{Z}$ is an integral domain, so is  $\mathbb{Z}[x,y]$ and since  $x^2 + y^2 = n$ is irreducible, so is $\mathbb{Z}[x,y]/(x^2 + y^2 = n)$.  This tells a few things, such as $(0)$ is prime.
it is not a PID e.g. $(2,x)$ is still prime. 

Could there be a Gröbner basis approach.  Since $\mathbb{Z}[x,y]$ is generated by monomials $x^a\, y^b$  maybe we could look at the images mod $x^2 + y^2 - n$.  In that case:
$$ x^a \,y^{2b+(0\text{ or  }1)} \equiv x^a \, (n - x^2)^b \,   y^{(0\text{ or  }1)} $$
At least, this would qualify what I mean by the word "compute".  The primes over $\mathbb{Z}[x,y]$ are the irreducibles and we could ask whether any of these split over $(x^2 + y^2 - n)$.
 A: The ring $R=\mathbb Z[x,y]:= \mathbb{Z}[X,Y]/\langle X^2+Y^2-n\rangle $ has Krull dimension $2$, so is certainly not a PID since PID's have Krull dimension $1$.
 Let's now have a look  at the scheme $S:=\operatorname {Spec}R$, which is an "arithmetic surface".    
$\bullet$ The ring   $R$ has exactly one prime ideal of height zero: the zero ideal $\langle 0_R\rangle \subset R$.
It corresponds to the  generic point $\eta$ of the scheme $S$.     
$\bullet \bullet$ The ring $R$ has  prime ideals of height $1$: such an ideal may be thought of as the generic point of an integral curve drawn on the surface $S$.
For example the prime ideal you mentioned, $\langle x-a,y-b \rangle$ where $a^2+b^2=n$, has height one.
But there might be other prime ideals of height one: for example if $n=3$ we may take the ideal $\langle x\rangle$.    
$\bullet \bullet \bullet$ Finally we have the prime ideals of height two, which are exactly the maximal ideals of $R$.
They correspond to the closed points of our surface $S$.
Supposing again that $n=3$, the prime ideal $\langle x,y\rangle$ is such a maximal ideal. 
