2. Solve $1,3,6,8$ where the difference between every two numbers is a prime number, so $f(1), f(3), f(6), f(8)$ are all distinct, $|A|$ $\geqslant 4$. On the other hand, let $A=\{0,1,2,3\}$. For each natural number $n$, let $f(n)$ be the remainder when $n$ is divided by 4, then when $f(i)=f(j)$, $|i-j|$ is divisible by 4. Therefore, $f$ is a function that satisfies the condition. Thus, the minimum number of elements in $A$ is 4.
2. (Balkan Mathematical Olympiad) For a finite set $A$, there exists a function $f: N \rightarrow A$ with the following property: if $|i-j|$ is a prime number, then $f(i) \neq f(j), N=\{1,2, \cdots\}$. Find the minimum number of elements in the finite set $A$.

