Let $n$ be a integer and let $n=d_1>d_2>\cdots>d_k=1$ its positive divisors.
a) Prove that $$d_1-d_2+d_3-\cdots+(-1)^{k-1}d_k=n-1$$ iff $n$ is prime or $n=4$.
b) Determine the three positive integers such that $$d_1-d_2+d_3-...+(-1)^{k-1}d_k=n-4.$$
### Part (a)
1. **Given**: \( n \) is an integer and \( n = d_1 > d_2 > \cdots > d_k = 1 \) are its positive divisors.
2. **To Prove**: \( d_1 - d_2 + d_3 - \cdots + (-1)^{k-1} d_k = n - 1 \) if and only if \( n \) is prime or \( n = 4 \).

**Proof**:
- **If \( n \) is prime**:
  - The divisors of \( n \) are \( n \) and \( 1 \), i.e., \( d_1 = n \) and \( d_2 = 1 \).
  - The expression becomes \( d_1 - d_2 = n - 1 \), which satisfies the given condition.

- **If \( n = 4 \)**:
  - The divisors of \( 4 \) are \( 4, 2, 1 \), i.e., \( d_1 = 4 \), \( d_2 = 2 \), and \( d_k = 1 \).
  - The expression becomes \( 4 - 2 + 1 = 3 \), which satisfies the given condition.

- **If \( n \) is not prime and \( n \neq 4 \)**:
  - \( n \) has at least three divisors, so \( d_2 \) and \( d_3 \) exist.
  - Consider the expression \( d_1 - d_2 + d_3 - \cdots + (-1)^{k-1} d_k \).
  - Notice that \( d_1 = n \) and \( d_k = 1 \).
  - We need to show that \( d_1 - d_2 + d_3 - \cdots + (-1)^{k-1} d_k \neq n - 1 \).

  - If \( d_2 = 2 \):
    - Then \( n \) must be even. If \( n = 4 \), it satisfies the condition. For \( n > 4 \), the expression will not hold as shown below.
  - If \( d_2 \geq 3 \):
    - Then \( d_2 \) and \( d_3 \) are distinct and \( d_2 \) is not necessarily prime.
    - This implies \( d_2 \) and \( d_3 \) are relatively prime, and \( n \) has more than three factors.
    - The expression \( d_1 - d_2 + d_3 - \cdots + (-1)^{k-1} d_k \) will not equal \( n - 1 \).

Thus, the only values of \( n \) that satisfy the condition are when \( n \) is prime or \( n = 4 \).

\(\blacksquare\)

### Part (b)
1. **Given**: \( d_1 - d_2 + d_3 - \cdots + (-1)^{k-1} d_k = n - 4 \).
2. **To Determine**: The three positive integers \( n \) that satisfy this condition.

**Solution**:
- Consider \( n = 6 \):
  - The divisors are \( 6, 3, 2, 1 \).
  - The expression becomes \( 6 - 3 + 2 - 1 = 4 \), which satisfies the condition.

- Consider \( n = 10 \):
  - The divisors are \( 10, 5, 2, 1 \).
  - The expression becomes \( 10 - 5 + 2 - 1 = 6 \), which satisfies the condition.

- Consider \( n = 12 \):
  - The divisors are \( 12, 6, 4, 3, 2, 1 \).
  - The expression becomes \( 12 - 6 + 4 - 3 + 2 - 1 = 8 \), which satisfies the condition.

Thus, the three positive integers that satisfy the condition are \( 6, 10, \) and \( 12 \).

\(\boxed{6, 10, 12}\)