Skip to content

Instantly share code, notes, and snippets.

@HamsterofDeath
Created May 25, 2019 22:50
Show Gist options
  • Select an option

  • Save HamsterofDeath/191e433d7b35effc6012b501ebde69b9 to your computer and use it in GitHub Desktop.

Select an option

Save HamsterofDeath/191e433d7b35effc6012b501ebde69b9 to your computer and use it in GitHub Desktop.
import kotlin.math.roundToInt
object N19 {
@JvmStatic
fun main(args: Array<String>) {
fun rand() = (Math.random()*1000000).roundToInt()
val seq = generateSequence { rand() }
val samples = seq.take(10000)
println(samples.count { it % 19 == 0 })
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment