(1) Find all positive integer $n$ such that for any odd integer $a$, we have $4\mid a^n-1$
(2) Find all positive integer $n$ such that for any odd integer $a$, we have $2^{2017}\mid a^n-1$
### Part (1)
We need to find all positive integers \( n \) such that for any odd integer \( a \), we have \( 4 \mid a^n - 1 \).

1. **Using the Lifting the Exponent Lemma (LTE):**
   The LTE lemma states that for odd \( a \) and \( b \), and \( n \) a positive integer, we have:
   \[
   \nu_2(a^n - b^n) = \nu_2(a - b) + \nu_2(a + b) + \nu_2(n) - 1
   \]
   Here, we set \( b = 1 \), so:
   \[
   \nu_2(a^n - 1) = \nu_2(a - 1) + \nu_2(a + 1) + \nu_2(n) - 1
   \]

2. **Analyzing the conditions:**
   Since \( a \) is odd, \( a - 1 \) and \( a + 1 \) are consecutive even numbers. Therefore:
   \[
   \nu_2(a - 1) \geq 1 \quad \text{and} \quad \nu_2(a + 1) \geq 1
   \]
   Hence:
   \[
   \nu_2(a - 1) + \nu_2(a + 1) \geq 2
   \]

3. **Ensuring \( 4 \mid a^n - 1 \):**
   We need:
   \[
   \nu_2(a^n - 1) \geq 2
   \]
   Substituting the values, we get:
   \[
   \nu_2(a^n - 1) = \nu_2(a - 1) + \nu_2(a + 1) + \nu_2(n) - 1 \geq 2
   \]
   Since \( \nu_2(a - 1) + \nu_2(a + 1) \geq 2 \), we have:
   \[
   2 + \nu_2(n) - 1 \geq 2 \implies \nu_2(n) \geq 1
   \]
   Therefore, \( n \) must be even.

4. **Conclusion:**
   All even \( n \) work.

### Part (2)
We need to find all positive integers \( n \) such that for any odd integer \( a \), we have \( 2^{2017} \mid a^n - 1 \).

1. **Using the Lifting the Exponent Lemma (LTE):**
   Again, using the LTE lemma for \( a \) odd and \( b = 1 \):
   \[
   \nu_2(a^n - 1) = \nu_2(a - 1) + \nu_2(a + 1) + \nu_2(n) - 1
   \]

2. **Analyzing the conditions:**
   Since \( a \) is odd, \( a - 1 \) and \( a + 1 \) are consecutive even numbers. Therefore:
   \[
   \nu_2(a - 1) \geq 1 \quad \text{and} \quad \nu_2(a + 1) \geq 1
   \]
   Hence:
   \[
   \nu_2(a - 1) + \nu_2(a + 1) \geq 2
   \]

3. **Ensuring \( 2^{2017} \mid a^n - 1 \):**
   We need:
   \[
   \nu_2(a^n - 1) \geq 2017
   \]
   Substituting the values, we get:
   \[
   \nu_2(a^n - 1) = \nu_2(a - 1) + \nu_2(a + 1) + \nu_2(n) - 1 \geq 2017
   \]
   Since \( \nu_2(a - 1) + \nu_2(a + 1) \geq 2 \), we have:
   \[
   2 + \nu_2(n) - 1 \geq 2017 \implies \nu_2(n) \geq 2016
   \]
   Therefore, \( n \) must be of the form \( n = 2^{2016}k \) where \( k \) is a positive integer.

4. **Conclusion:**
   \( n = 2^{2016}k \) for any positive integer \( k \).

The final answer is \( \boxed{ n } \) is even for part (1) and \( n = 2^{2016}k \) for part (2).