2 test cases wrong out of 6

please tell where my code is wrong
here is my code-

Hello @pragyachoudhary1111,

You have confined your answer to 5000005.
So, it is producing wrong answer for greater value of n(input).

Solution:
Make N=100000007

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