AIME number theory problem (unique factorization domains) I'd greatly appreciate some help with the following problem, from a mock AIME I took.
Compute the largest squarefree positive integer $n$ such that $\mathbb{Q}(\sqrt{-n})\cap \overline{\mathbb{Z}}$ is a unique factorization domain. 
 A: This is a joke as in "mock the AIME (by smarter-than-thou high school students who wrote the mock problem)", not a "mock test problem to prepare for the real test".  
Explanation: it is a test of general knowledge more advanced than the level of the competition, including notation that is meant to be unfamiliar to many users of the mock test.
$\bar{Z}$ is the algebraic integers (algebraic numbers that are roots of a monic polynomial with $Q$ coefficients). 
$Q(\sqrt{-n}) \cap \bar{Z}$ is the ring of integers in the quadratic field $Q(\sqrt{-n})$.
It is well known (but mentioned later in most people's mathematics education) that there are $10$ values of $n$ for which that ring has unique factorization, the largest being $163$.  The proof is a notoriously hard problem that was unsolved for about 150 years, after being stated as a conjecture by Gauss based on his rather extensive theory of quadratic forms.  It is not something that could possibly be solved during a competition.
The problem is a way for some students to signal others that they are more/equally precocious, depending on whether the others got the joke or not.
A: Equivalently, you are asking for the largest squarefree integer $n$ such that  $\mathbb{Q}[\sqrt{-n}]\cap\overline{\mathbb{Z}}$ has class number $1$. It was conjectured by Gauss that $n=163$, but this was not proven until 1952, and it is now known as the Stark-Heegner Theorem.
