Let $p$ be a prime number. Call a positive integer $n$ interesting if 
\[x^n-1=(x^p-x+1)f(x)+pg(x)\]
for some polynomials $f$ and $g$ with integer coefficients.
a) Prove that the number $p^p-1$ is interesting.
b) For which $p$ is $p^p-1$ the minimal interesting number?
### Part (a)

1. **Irreducibility of \(x^p - x + 1\) over \(\mathbb{F}_p\)**:
   - Consider the finite field \(K = \mathbb{F}_p\).
   - The polynomial \(x^p - x + 1\) is irreducible over \(K\). Let \(\alpha\) be a root of this polynomial in some extension field of \(K\).

2. **Degree of the extension**:
   - Since \(x^p - x + 1\) is irreducible over \(K\), the degree of the extension \(K(\alpha)\) over \(K\) is \(p\), i.e., \([K(\alpha) : K] = p\).

3. **Order of the field \(K(\alpha)\)**:
   - The field \(K(\alpha)\) is a finite field with \(p^p\) elements, i.e., \(|K(\alpha)| = p^p\).

4. **Properties of finite fields**:
   - In a finite field with \(q\) elements, every element \(\beta\) satisfies \(\beta^{q-1} = 1\). Therefore, in \(K(\alpha)\), we have \(\alpha^{p^p - 1} = 1\).

5. **Conclusion**:
   - Since \(\alpha^{p^p - 1} = 1\), \(\alpha\) is a root of \(x^{p^p - 1} - 1\).
   - Given that \(x^p - x + 1\) is irreducible, it divides \(x^{p^p - 1} - 1\). Hence, there exist polynomials \(f(x)\) and \(g(x)\) with integer coefficients such that:
     \[
     x^{p^p - 1} - 1 = (x^p - x + 1)f(x) + pg(x).
     \]
   - Therefore, \(p^p - 1\) is interesting.

### Part (b)

1. **Case \(p = 2\)**:
   - For \(p = 2\), we need to check if \(3\) is the minimal interesting number.
   - The polynomial \(x^2 - x + 1\) is irreducible over \(\mathbb{F}_2\).
   - The field \(\mathbb{F}_2(\alpha)\) has \(4\) elements, and \(\alpha^3 = 1\).
   - Therefore, \(3\) is interesting for \(p = 2\).

2. **Case \(p\) is odd**:
   - Let \(\alpha\) be a root of \(x^p - x + 1\) in some extension field of \(\mathbb{F}_p\).
   - We have \(\alpha^p = \alpha - 1\) and \(\alpha^{p^k} = \alpha - k\).
   - Notice that \(\alpha - k\) is also a root of \(x^p - x + 1\).

3. **Using \(m = 1 + p + p^2 + \dots + p^{p-1} = \frac{p^p - 1}{p - 1}\)**:
   - We have \(\alpha^m = \prod (\alpha - k)\), where \(k\) ranges from \(0\) to \(p-1\).
   - This product is, up to sign, the constant term of \(x^p - x + 1\), which is \(1\).
   - Therefore, \(\alpha^m = (-1)^p \cdot 1\), and \(\alpha^{2m} = 1\).

4. **Conclusion for minimal interesting number**:
   - If \(p > 3\), then \(2m < p^p - 1\).
   - Therefore, for odd \(p\), the minimal interesting number is \(p^p - 1\).

The final answer is \( \boxed{ p^p - 1 } \) for odd \(p\) and \(3\) for \(p = 2\).