Sum of the sequence 2 , 22 , 222 , ... ... ... | function which return the the sum of series ; Driver code
function sumOfSeries ( n ) { return 0.0246 * ( Math . pow ( 10 , n ) - 1 - ( 9 * n ) ) ; } let n = 3 ; document . write ( sumOfSeries ( n ) ) ;