Why we do +1 in this

why we do +1 in this

if we were running a seq
which was of length 5 so far
and now we have found another number which satisfies so we want to add this number to the sequence and then get it’s length
so for example
1 2 3 4 5 6
uptil 5 we have length 5
so when we reach 6 we need to +1 to make it 6 that’s why