Ideals of affine space curves Given some algebraic closed curve in the affine space $\mathbb{A}^3_\mathbb{C}$, is there a way to decide whether its ideal (polynomials in $\mathbb{C}[X,Y,Z]$ vanishing on the curve) is generated by two elements?
I am mostly interested in the case where the curve is smooth and irreducible.
 A: There is a necessary condition: the element in the divisor class group of the affine curve
coming from the cotangent sheaf of the curve must be trivial.  If $I$ is generated by two elements, then $I/I^2$ is a free sheaf of rank $2$ on the curve.  By adjunction, this forces the cotangent sheaf of the curve to be trivial.  This immediately suggests how to make examples where $I$ is not generated by two elements.  Begin with a smooth, projective curve $X$ of genus $g>1$.  Let $x$ be a closed point such that $\omega_X(-(2g-2)\underline{x})$ is nontorsion.  For integers $N\gg 0$, the divisor $N\underline{x}$ is very ample.  For three general sections $f_1,f_2,f_3$ of $\Gamma(X,\mathcal{O}_X(N\underline{x}))$, form the morphism $(f_1,f_2,f_3):X\setminus\{x\} \to \mathbb{A}^3$.  If $f_1,f_2,f_3$ are sufficiently general, this will be a closed immersion.  The image is a smooth curve whose ideal $I$ is not generated by two elements.
$\textbf{Edit.}$  According to my computations, if $X$ is a genus $2$ curve and $x$ is a generic (hence non-hyperelliptic) point, then the linear system $|5\underline{x}|$ is sufficient for this argument.  This will embed $X$ in $\mathbb{P}^3$ as a degree $5$ curve whose "osculating 2-plane" $H$ at $x$ has contact of order $5$.  Thus the complement of $H$ will be an affine space $\mathbb{A}^3$ and $X\setminus (X\cap H)$ equals $X\setminus\{x\}$ is an affine curve whose ideal is not generated by two elements.
$\textbf{Second edit.}$  Using "Serre's Construction" and the Quillen-Suslin theorem (perhaps avoidable), you can show that the necessary condition above is also sufficient.  Let $R$ denote $k[x_1,x_2,x_3]$, and let $I$ denote the defining ideal of the affine curve $C$.  Then $\text{Ext}^1_R(I,R)$ is annihilated by $I$, i.e., equivalent to an $R/I$-module.  As an $R/I$-module, it is isomorphic to the dual of $\bigwedge^2(I/I^2)$, which is isomorphic to $R/I$ by hypothesis.  Choose an element that generates this $R/I$-module, i.e., $0\to R \to F \to I \to 0$.  Since $I$ is locally generated by 2 elements, it is not hard to check that $F$ is a locally free $R$-module of rank 2.  By the Quillen-Suslin theorem (or perhaps something weaker), $F$ is a free $R$-module of rank $2$.
$\textbf{Third edit.}$  I just noticed that there are some nice notes on "Serre's construction" (used above) written by my colleague, Christian Schnell.  Here is the URL:http://www.math.sunysb.edu/~cschnell/pdf/notes/serre.pdf.
