Suppose $X \subset \mathbb{A}^n$ is an affine variety; Given $p \not\in \{p_1,..,p_k\}$, with $p, p_1, ..., p_k \in X$, how can I find $f \in A(X)$ vanishing on all the $p_i$ but not on $p$?
If $k = 1$, I could just take some hyperplane containing $p_1$ and not $p$. Is it possible to just multiply all such hyperplanes (i.e. the polynomials yielding them as their zero locus)?
EDIT: I stated the problem wrong (the title is correct, though): I want a function $f \in A(X)$ vanishing on $p$ but not on any of the $p_i$. What could I do to obtain such an $f$?