Consider $n$ points $A_1, A_2, \ldots, A_n$ on a circle.  How many ways are there if we want to color these points by $p$ colors, so that each two neighbors points are colored with two different colors?
1. **Case when \( p = 2 \):**
   - If \( n \) is even, we can alternate the two colors around the circle. There are 2 ways to do this (starting with either color).
   - If \( n \) is odd, it is impossible to color the points such that no two adjacent points have the same color. Therefore, there are no valid colorings.

2. **Case when \( p \geq 3 \):**
   - We need to find the number of ways to color \( n \) points on a circle using \( p \) colors such that no two adjacent points have the same color.
   - Let \( f(C_n, p) \) denote the number of valid colorings of \( n \) points on a circle using \( p \) colors.
   - Let \( f(P_n, p) \) denote the number of valid colorings of \( n \) points on a path using \( p \) colors.

3. **Recursive Relation:**
   - We can establish a recursive relation between \( f(C_n, p) \) and \( f(P_n, p) \).
   - By removing an edge from the circle, we transform \( C_n \) into \( P_n \). Thus, every valid coloring of \( C_n \) is also a valid coloring of \( P_n \).
   - Conversely, the only valid colorings of \( P_n \) that extend to valid colorings of \( C_n \) are those where the end vertices of \( P_n \) have different colors.
   - The colorings of \( P_n \) where the end vertices have the same color correspond to colorings of \( C_{n-1} \) (where the end vertices are identified as a single vertex).

4. **Formulating the Recursive Relation:**
   - Therefore, we have:
     \[
     f(C_n, p) = f(P_n, p) - f(C_{n-1}, p)
     \]

5. **Base Case for Path:**
   - The number of valid colorings of \( P_n \) is given by:
     \[
     f(P_n, p) = p(p-1)^{n-1}
     \]
     This is because the first vertex can be colored in \( p \) ways, and each subsequent vertex can be colored in \( p-1 \) ways (different from its predecessor).

6. **Induction:**
   - Using the base case and the recursive relation, we can compute \( f(C_n, p) \) for any \( n \) and \( p \geq 3 \).

The final answer is \( \boxed{ f(C_n, p) = p(p-1)^{n-1} - f(C_{n-1}, p) } \) for \( p \geq 3 \). For \( p = 2 \), the answer is 2 if \( n \) is even and 0 if \( n \) is odd.