Here i am solving this question from gfg…
Name-Recursive Sequence…
Question link–> https://practice.geeksforgeeks.org/problems/recursive-sequence/0
This is my solution…
I have used long long int then also it is showing wrong output for n>=7 it is showing right output till 1 to 6.
Please check this…