Created
May 25, 2019 22:50
-
-
Save HamsterofDeath/191e433d7b35effc6012b501ebde69b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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