Super | Function to find the divisors ; Loop to iterate over the square root of the N ; Check if divisors are equal ; Function to check if N is a super Poulet number ; Loop to check that every divisor divides 2 ^ D - 2 ; Driver Code
function findDivisors ( n ) { let divisors = [ ] for ( let i = 1 ; i < Math . floor ( Math . sqrt ( n ) + 1 ) ; i ++ ) { if ( n % i == 0 ) { if ( n / i == i ) { divisors . push ( i ) } else { divisors . push ( i ) divisors . push ( Math . floor ( n / i ) ) } } } return divisors . sort ( ( a , b ) => a - b ) } function isSuperdNum ( n ) { let d = findDivisors ( n ) for ( let i in d ) { let x = ( 2 ** i - 2 ) / i if ( Math . floor ( x ) != x ) { return false } } return true } let n = 341 if ( isSuperdNum ( n ) == true ) { document . write ( " " ) } else { document . write ( " " ) }