Count of digits after concatenation of first N positive integers | Java program to find the number of digits after concatenating the first N positive integers ; Function to find the number of digits after concatenating the first N positive integers ; Driver code
class GFG { static void numberOfDigits ( int N ) { int nod = ( int ) Math . floor ( Math . log10 ( N ) + 1 ) ; int toDecrease = ( int ) ( Math . pow ( 10 , nod ) - 1 ) / 9 ; System . out . print ( ( N + 1 ) * nod - toDecrease ) ; } public static void main ( String [ ] args ) { int N = 13 ; numberOfDigits ( N ) ; } }