We can solve for n thusly
Sum = (first term + last term) (number of terms) /2
Note.....number of terms = n - 20 + 1 = n -19
So we have that
(20 + n) ( n - 19)/2 = 2021 multiply through by 2 and simplify
n^2 + n - 380 = 4042 subtract 4042 from both sides
n^2 + n - 4422 = 0
We can factor this as
(n + 67) ( n - 66) = 0
The second factor set = 0 gives us the positive answer we need for n
n - 66 = 0
n = 66