Code to solve nth-acci sequence problem

Code to solve nth-acci sequence problem