Let $p$ be an odd prime number. For positive integer $k$ satisfying $1\le k\le p-1$, the number of divisors of $kp+1$ between $k$ and $p$ exclusive is $a_k$. Find the value of $a_1+a_2+\ldots + a_{p-1}$.
1. **Understanding the Problem:**
   We need to find the sum \( a_1 + a_2 + \ldots + a_{p-1} \), where \( a_k \) is the number of divisors of \( kp + 1 \) that lie strictly between \( k \) and \( p \).

2. **Analyzing the Divisors:**
   For each \( k \) in the range \( 1 \le k \le p-1 \), consider the number \( kp + 1 \). We need to count the divisors of \( kp + 1 \) that are strictly between \( k \) and \( p \).

3. **Claim:**
   For a fixed \( m \) (where \( 1 < m < p \)), \( m \) contributes exactly once to one of \( a_1, a_2, \ldots, a_{m-1} \).

4. **Proof of the Claim:**
   Consider the numbers \( p+1, 2p+1, \ldots, (m-1)p+1 \). We need to show that \( m \) divides exactly one of these numbers.

   - Since \( \gcd(m, p) = 1 \) (because \( p \) is a prime and \( m < p \)), \( m \) does not divide \( p \).
   - Therefore, \( m \) must divide \( kp + 1 \) for some \( k \) in the range \( 1 \le k \le m-1 \).

   To see why, consider the congruences:
   \[
   p+1 \equiv 1 \pmod{m}, \quad 2p+1 \equiv 2 \pmod{m}, \quad \ldots, \quad (m-1)p+1 \equiv m-1 \pmod{m}
   \]
   Since \( \gcd(m, p) = 1 \), the numbers \( p, 2p, \ldots, (m-1)p \) form a complete residue system modulo \( m \). Thus, \( kp + 1 \) will be congruent to \( 1, 2, \ldots, m-1 \) modulo \( m \), respectively.

   Therefore, \( m \) will divide exactly one of these numbers \( kp + 1 \) for \( k \) in the range \( 1 \le k \le m-1 \).

5. **Summing Up Contributions:**
   Each \( m \) (where \( 1 < m < p \)) contributes exactly once to one of \( a_1, a_2, \ldots, a_{m-1} \). Since there are \( p-2 \) such \( m \) (from \( 2 \) to \( p-1 \)), the total sum \( a_1 + a_2 + \ldots + a_{p-1} \) is \( p-2 \).

The final answer is \(\boxed{p-2}\).