Driver code
let n ; n = 8 ; document . write ( nthTermOfTheSeries ( n ) + " " ) ; n = 12 ; document . write ( nthTermOfTheSeries ( n ) + " " ) ; n = 102 ; document . write ( nthTermOfTheSeries ( n ) + " " ) ; n = 999 ; document . write ( nthTermOfTheSeries ( n ) + " " ) ; n = 9999 ; document . write ( nthTermOfTheSeries ( n ) + " " ) ;