Determine all positive integers $n>1$ such that for any divisor $d$ of $n,$ the numbers $d^2-d+1$ and $d^2+d+1$ are prime.

[i]Lucian Petrescu[/i]
To determine all positive integers \( n > 1 \) such that for any divisor \( d \) of \( n \), the numbers \( d^2 - d + 1 \) and \( d^2 + d + 1 \) are prime, we proceed as follows:

1. **Consider the divisors of \( n \):**
   Let \( d \) be a divisor of \( n \). We need to check the primality of \( d^2 - d + 1 \) and \( d^2 + d + 1 \).

2. **Analyze the congruence conditions:**
   - If \( d \equiv 1 \pmod{3} \) and \( d > 1 \), then:
     \[
     d^2 + d + 1 \equiv 1^2 + 1 + 1 \equiv 3 \equiv 0 \pmod{3}
     \]
     This implies \( d^2 + d + 1 \) is divisible by 3. Since \( d > 1 \), \( d^2 + d + 1 > 3 \), so \( d^2 + d + 1 \) cannot be prime.

   - If \( d \equiv 2 \pmod{3} \) and \( d > 2 \), then:
     \[
     d^2 - d + 1 \equiv 2^2 - 2 + 1 \equiv 4 - 2 + 1 \equiv 3 \equiv 0 \pmod{3}
     \]
     This implies \( d^2 - d + 1 \) is divisible by 3. Since \( d > 2 \), \( d^2 - d + 1 > 3 \), so \( d^2 - d + 1 \) cannot be prime.

3. **Determine possible values of \( n \):**
   From the above analysis, \( d \) must be such that \( d \equiv 0 \pmod{3} \) or \( d = 1 \) or \( d = 2 \).

   - If \( n = 3^k \), then \( d = 3^i \) for \( i \leq k \). For \( d = 3 \):
     \[
     3^2 + 3 + 1 = 9 + 3 + 1 = 13 \quad (\text{prime})
     \]
     \[
     3^2 - 3 + 1 = 9 - 3 + 1 = 7 \quad (\text{prime})
     \]
     However, for \( k \geq 2 \), \( 9^2 + 9 + 1 = 91 = 7 \times 13 \) is not prime. Thus, \( k < 2 \).

   - If \( n = 2 \cdot 3^k \), then \( d = 1, 2, 3 \). For \( d = 2 \):
     \[
     2^2 + 2 + 1 = 4 + 2 + 1 = 7 \quad (\text{prime})
     \]
     \[
     2^2 - 2 + 1 = 4 - 2 + 1 = 3 \quad (\text{prime})
     \]
     For \( d = 3 \), as shown above, both expressions are prime. However, for \( k \geq 2 \), the same issue with \( 9 \) arises.

4. **Conclusion:**
   The possible values of \( n \) are \( 2, 3, \) and \( 6 \).

The final answer is \( \boxed{ n = 2, 3, 6 } \).