For positive integers $n$, let $\tau (n)$ denote the number of positive integer divisors of $n$, including $1$ and $n$. For example, $\tau (1)=1$ and $\tau(6) =4$. Define $S(n)$ by \[S(n)=\tau(1)+ \tau(2) + ... + \tau(n).\] Let $a$ denote the number of positive integers $n \leq 2005$ with $S(n)$ odd, and let $b$ denote the number of positive integers $n \leq 2005$ with $S(n)$ even. Find $|a-b|$.
1. **Understanding the function $\tau(n)$:**
   - $\tau(n)$ denotes the number of positive integer divisors of $n$. For example, $\tau(1) = 1$ and $\tau(6) = 4$.
   - $\tau(n)$ is odd if and only if $n$ is a perfect square. This is because the divisors of a non-square number come in pairs, while a square number has a middle divisor that is repeated (e.g., for $n = 9$, the divisors are $1, 3, 9$).

2. **Defining $S(n)$:**
   - $S(n) = \tau(1) + \tau(2) + \cdots + \tau(n)$.
   - We need to determine the parity (odd or even) of $S(n)$ for $n \leq 2005$.

3. **Analyzing the parity of $S(n)$:**
   - Since $\tau(n)$ is odd if $n$ is a perfect square and even otherwise, we need to count the number of perfect squares up to $n$.
   - Let $k$ be the number of perfect squares $\leq n$. Then $k = \lfloor \sqrt{n} \rfloor$.

4. **Counting perfect squares up to 2005:**
   - $\lfloor \sqrt{2005} \rfloor = 44$ (since $44^2 = 1936$ and $45^2 = 2025$ which is greater than 2005).
   - Therefore, there are 44 perfect squares up to 2005.

5. **Determining the parity of $S(n)$:**
   - For $S(n)$ to be odd, the number of odd $\tau(i)$ values (i.e., the number of perfect squares) must be odd.
   - For $S(n)$ to be even, the number of odd $\tau(i)$ values must be even.

6. **Counting $a$ and $b$:**
   - $a$ is the number of $n \leq 2005$ for which $S(n)$ is odd.
   - $b$ is the number of $n \leq 2005$ for which $S(n)$ is even.
   - Since there are 44 perfect squares, $S(n)$ will be odd for $n = 1, 2, \ldots, 2005$ when the count of perfect squares up to $n$ is odd.
   - This alternates every time we pass a perfect square.

7. **Calculating $a$ and $b$:**
   - There are 2005 numbers in total.
   - Since the number of perfect squares is 44, the number of intervals where $S(n)$ is odd is 22 (since 44 is even, half of the intervals will have an odd count of perfect squares).
   - Therefore, $a = 1003$ and $b = 1002$.

8. **Finding $|a - b|$:**
   - $|a - b| = |1003 - 1002| = 1$.

The final answer is $\boxed{1}$