Mersenne Prime Oracle Please give me any feedback regarding good coding standards and readability.

fun main(arg: Array&lt;String&gt;) {

    //do while user guess != Mersenne Prime.
    do {
        //initializing variable
        var number: Int = 3
        try {
            number = readLine()!!.toInt()

            if (isMersennePrime(number)) 
            println("${number} is a Mersenne Prime. Congratulations.")

            else 
            println("${number} is not a Mersenne Prime.")
        }
        catch (e: NumberFormatException) {
            println(" is not a valid number. Exiting.")
        }
    } while (!isMersennePrime(number))
}

    // is Number both prime and 2^n - 1? 
    fun isMersennePrime(Number: Int): Boolean =    
    (twonminus1(Number.toDouble()) &amp;&amp; isPrime(Number))

    // is x Prime?
    fun isPrime(x: Int): Boolean = (2..x-1).all{x % it != 0 &amp;&amp; x != 2}

    // is x = 2^n - 1?
    fun twonminus1(x: Double): Boolean = Math.log(x + 1.0)/Math.log(2.0) % 1.0 == 0.0
Do not use double arithmetics when integer arithmetics can solve the problem as well. The function isPowerOfTwoMinus1 can be written simply as ((x + 1) &amp; x) == 0.

Don't call isMersennePrime twice, just break from the loop.