Smallest number whose sum of digits is square of N | Function to return smallest number whose sum of digits is n ^ 2 ; Driver Code
def smallestNum ( n ) : NEW_LINE INDENT return ( ( n * n % 9 + 1 ) * pow ( 10 , int ( n * n / 9 ) ) - 1 ) NEW_LINE DEDENT N = 4 NEW_LINE print ( smallestNum ( N ) ) NEW_LINE