Answer is Coming in ide but not in submission

Hey, Please look at the code and tell me what’s the error i have made
Here is the link…

Hello @acharyadhwanan29,

Please, correct the logic you have applied.
It is failing for the test cases like:
1
1 10
Expected Output:
2
3
5
7
Your Output:
1
5
7

Hope, this would help.
Give a like if you are satisfied.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.