Minimum value exceeding X whose count of divisors has different parity with count of divisors of X | Function to find the minimum value exceeding x whose count of divisors has different parity with count of divisors of X ; Check if x is perfect square ; Driver code
function minvalue_y ( x ) { let n = Math . floor ( Math . sqrt ( x ) ) ; if ( n * n == x ) return x + 1 ; return Math . floor ( Math . pow ( n + 1 , 2 ) ) ; } let x = 5 ; document . write ( minvalue_y ( x ) ) ;