Find Nth positive number whose digital root is X | Java program to find the N - th number with digital root as X ; Function to find the N - th number with digital root as X ; Driver Code
class GfG { static int findAnswer ( int X , int N ) { return ( N - 1 ) * 9 + X ; } public static void main ( String [ ] args ) { int X = 7 , N = 43 ; System . out . println ( findAnswer ( X , N ) ) ; } }