Heptagonal number | Function to return Nth Heptagonal number ; Drivers Code
function heptagonalNumber ( n ) { return parseInt ( ( ( 5 * n * n ) - ( 3 * n ) ) / 2 ) ; } let n = 2 ; document . write ( heptagonalNumber ( n ) + " " ) ; n = 15 ; document . write ( heptagonalNumber ( n ) + " " ) ;