Find Nth positive number whose digital root is X | Function to find the N - th number with digital root as X ; Driver Code
< ? php function findAnswer ( $ X , $ N ) { return ( $ N - 1 ) * 9 + $ X ; } $ X = 7 ; $ N = 43 ; echo ( findAnswer ( $ X , $ N ) ) ; ? >