Driver code
let n = 5 ; document . write ( nthTerm ( n ) + " " ) ; n = 25 ; document . write ( nthTerm ( n ) + " " ) ; n = 25000000 ; document . write ( nthTerm ( n ) + " " ) ; n = 250000007 ; document . write ( nthTerm ( n ) + " " ) ;