Count of digits after concatenation of first N positive integers | Function to find the number of digits after concatenating the first N positive integers ; Driver code
function numberOfDigits ( N ) { let nod = Math . floor ( Math . log10 ( N ) + 1 ) ; let toDecrease = ( Math . pow ( 10 , nod ) - 1 ) / 9 ; document . write ( ( N + 1 ) * nod - toDecrease ) ; } let N = 13 ; numberOfDigits ( N ) ;