Program to find the Nth number of the series 2 , 10 , 24 , 44 , 70. ... . | function to return nth term of the series ; Taking n as 4 ; Prleting the nth term
function NthTerm ( n ) { let x = ( 3 * n * n ) % 1000000009 ; return ( x - n + 1000000009 ) % 1000000009 ; } let N = 4 ; document . write ( NthTerm ( N ) ) ;