For each integer $n\geq0$, let $S(n)=n-m^2$, where $m$ is the greatest integer with $m^2\leq n$. Define a sequence by $a_0=A$ and $a_{k+1}=a_k+S(a_k)$ for $k\geq0$. For what positive integers $A$ is this sequence eventually constant?
1. **Define the function \( S(n) \):**
   \[
   S(n) = n - m^2
   \]
   where \( m \) is the greatest integer such that \( m^2 \leq n \).

2. **Define the sequence \( \{a_k\} \):**
   \[
   a_0 = A \quad \text{and} \quad a_{k+1} = a_k + S(a_k) \quad \text{for} \quad k \geq 0
   \]
   This can be rewritten using the function \( f(n) \):
   \[
   f(n) = n + S(n) = n + (n - m^2) = 2n - m^2
   \]
   Therefore, \( a_{k+1} = f(a_k) \).

3. **Condition for the sequence to be constant:**
   Suppose the sequence \( \{a_n\}_{n \geq i} \) is eventually constant. This means there exists some \( i \) such that \( a_{i+1} = a_i \). Hence,
   \[
   a_{i+1} = f(a_i) = 2a_i - m^2
   \]
   For the sequence to be constant, we must have:
   \[
   a_i = 2a_i - m^2 \implies a_i = m^2
   \]
   Therefore, for the sequence to be eventually constant, \( a_i \) must be a perfect square.

4. **Claim: If \( n \) is not a perfect square, then \( f(n) \) is also not a perfect square.**
   - Let \( n = m^2 + k \) where \( 0 < k \leq 2m \).
   - Then,
     \[
     f(n) = 2n - m^2 = 2(m^2 + k) - m^2 = m^2 + 2k
     \]
   - Note that:
     \[
     m^2 < f(n) \leq m^2 + 4m < (m+2)^2
     \]
   - If \( f(n) \) were a perfect square, it would have to be \( (m+1)^2 \). Thus,
     \[
     m^2 + 2k = (m+1)^2 \implies 2k = (m+1)^2 - m^2 = 2m + 1
     \]
   - This implies \( k = m + \frac{1}{2} \), which is a contradiction since \( k \) is an integer. Therefore, \( f(n) \) cannot be a perfect square if \( n \) is not a perfect square.

5. **Conclusion:**
   - If \( a_0 \) is not a perfect square, then none of the \( a_k \) will be a perfect square, and the sequence will not be eventually constant.
   - If \( a_0 \) is a perfect square, say \( a_0 = m^2 \), then:
     \[
     a_1 = f(a_0) = f(m^2) = 2m^2 - m^2 = m^2
     \]
     Thus, the sequence is constant from the start.

Therefore, the sequence \( \{a_k\} \) is eventually constant if and only if \( A \) is a perfect square.

The final answer is \( \boxed{ A } \) must be a perfect square.