Let $n>1$ be a positive integer. Find the number of binary strings $(a_1, a_2, \ldots, a_n)$, such that the number of indices $1\leq i \leq n-1$ such that $a_i=a_{i+1}=0$ is equal to the number of indices $1 \leq i \leq n-1$, such that $a_i=a_{i+1}=1$.
1. **Define Variables and Conditions:**
   Let \( n > 1 \) be a positive integer. We need to find the number of binary strings \((a_1, a_2, \ldots, a_n)\) such that the number of indices \(1 \leq i \leq n-1\) where \(a_i = a_{i+1} = 0\) is equal to the number of indices \(1 \leq i \leq n-1\) where \(a_i = a_{i+1} = 1\).

2. **Introduce Variables for Sequences:**
   Let \( a \) be the number of sequences of consecutive 1's, and \( b \) be the number of sequences of consecutive 0's. Let \( k \) be the total number of 1's, then the total number of 0's is \( n - k \).

3. **Formulate the Condition:**
   Since a sequence of \( n \) consecutive same numbers adds \( n-1 \) to the number of indices, we have:
   \[
   k - a = n - k - b
   \]
   Simplifying, we get:
   \[
   2k - a = n - b
   \]

4. **Analyze Possible Cases:**
   - If \( n \) is even, \( n = 2m \):
     \[
     k = m \quad \text{and} \quad a = b
     \]
   - If \( n \) is odd, \( n = 2m + 1 \):
     \[
     k = m \quad \text{and} \quad a = b - 1 \quad \text{or} \quad a = b + 1
     \]

5. **Count the Number of Valid Sequences for Even \( n \):**
   If \( n \) is even, \( k = \frac{n}{2} \). We need to divide \(\frac{n}{2}\) 1's into \( a \) intervals, where \( a \) runs from 1 to \(\frac{n}{2}\). The number of ways to arrange 1's for any \( a \) is:
   \[
   \binom{\frac{n}{2} - 1}{a - 1}
   \]
   Therefore, the number of ways to arrange the whole sequence for any \( a \) is:
   \[
   \binom{\frac{n}{2} - 1}{a - 1}^2
   \]
   Summing over all possible \( a \):
   \[
   \sum_{k=1}^{\frac{n}{2}} \binom{\frac{n}{2} - 1}{k - 1}^2 = \binom{n - 2}{\frac{n}{2} - 1}
   \]

6. **Count the Number of Valid Sequences for Odd \( n \):**
   If \( n \) is odd, \( k = \frac{n - 1}{2} \). We need to consider cases where \( a = b - 1 \) or \( a = b + 1 \). Since we can change all the 1's to 0's and vice versa, any sequence with \( a = b - 1 \) can be arranged into sequences that have \( a = b + 1 \). Thus, we only consider the cases where \( a = b - 1 \):
   \[
   k = \frac{n - 1}{2}
   \]
   The number of arrangements for any \( a \) is:
   \[
   \binom{\frac{n - 1}{2} - 1}{a - 1} \binom{\frac{n + 1}{2} - 1}{a}
   \]
   Summing over all possible \( a \):
   \[
   2 \sum_{k=1}^{\frac{n - 1}{2}} \binom{\frac{n - 1}{2} - 1}{k - 1} \binom{\frac{n + 1}{2} - 1}{k} = 2 \binom{\frac{n - 3}{2}}{n - 2} = 2 \binom{\frac{n - 1}{2}}{n - 2}
   \]

The final answer is \(\boxed{\binom{n-2}{\frac{n}{2}-1}}\) for even \( n \) and \(\boxed{2 \binom{\frac{n-1}{2}}{n-2}}\) for odd \( n \).