Given that $a_1, a_2, \ldots,a_{2020}$ are integers, find the maximal number of subsequences $a_i,a_{i+1}, ..., a_j$ ($0<i\leq j<2021$) with with sum $2021$
1. Define \( b_i = a_1 + a_2 + \cdots + a_i \) and \( b_0 = 0 \). The problem now is to find the maximum number of pairs \((i, j)\) with \(i < j\) such that \(b_j - b_i = 2021\). We call such pairs "good pairs".
2. We claim that the maximum number of good pairs is \(N = n^2 + n\), where \(n = 1010\). We will prove this by induction.

**Base Case:**
3. For \(n = 1\), we have \(b_0, b_1, b_2\). The only possible good pair is \((0, 1)\) if \(b_1 = 2021\). Thus, the number of good pairs is \(1 = 1^2 + 1\), which satisfies our claim.

**Inductive Step:**
4. Assume the claim is true for \(n = m\), i.e., the maximum number of good pairs for \(b_0, b_1, \ldots, b_{2m}\) is \(m^2 + m\).
5. Consider \(n = m + 1\). We need to show that the maximum number of good pairs for \(b_0, b_1, \ldots, b_{2(m+1)}\) is \((m+1)^2 + (m+1)\).

6. Let \(i\) be an index such that \(b_i \neq b_{i+1}\). If such an \(i\) does not exist, then all \(b_i\) are constant, which gives 0 good pairs. Otherwise, we can split the sequence into two parts: \(\{0, 1, 2, \ldots, i-1, i+2, \ldots, 2m\}\) and \(\{i, i+1\}\).

7. The number of good pairs can be broken down as follows:
   - Good pairs within \(\{0, 1, 2, \ldots, i-1, i+2, \ldots, 2m\}\): By the inductive hypothesis, this is \((m-1)^2 + (m-1)\).
   - Good pairs with one element from \(\{0, 1, 2, \ldots, i-1, i+2, \ldots, 2m\}\) and one from \(\{i, i+1\}\): There are \(2m - 1\) such pairs.
   - If \((i, i+1)\) is a good pair, add 1.

8. Summing these, we get:
   \[
   N \leq (m-1)^2 + (m-1) + (2m-1) + 1 = m^2 + m
   \]
   This completes the induction.

**Construction for the \(b_i\):**
9. Consider the sequence \(0, 0, \ldots, 0, 2021, 0, 0, \ldots, 0\). This construction ensures that there are \(n^2 + n\) good pairs.

The final answer is \( \boxed{ n^2 + n } \).