Find the Kth number which is not divisible by N | Function to find the Kth not divisible by N ; Driver code ; Function Call
function kthNonDivisible ( N , K ) { return K + parseInt ( Math . floor ( ( K - 1 ) / ( N - 1 ) ) , 10 ) ; } let N = 3 ; let K = 6 ; document . write ( kthNonDivisible ( N , K ) ) ;