I think code written by Sir is not correct

I think code written by Sir is not correct. Sir used the n there to check if it divides by 3 or 2 but I think we should check I that if it is divisible by 3 or 2. Only then we will be able to fill our do array.
Please check my code and in if condition sir used n there in Bottom Up Approach
Please tell me if I am wrong

yes you are right it should be i instead of n