Groovy web console

subscribe to the feed Subscribe
to this
site
Binomialkoeffizient (via #groovywebconsole)
tweet this snippet Tweet
this
script

Binomialkoeffizient

Published 8 months ago by Sebastian Butterweck
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
{ long n, long k -> { it -> { -> it > 1 ? it * owner.call(it-1) : 1 }() }(n) / ( { it -> { -> it > 1 ? it * owner.call(it-1) : 1 }() }(k) * { it -> { -> it > 1 ? it * owner.call(it-1) : 1 }() }(n-k) ) }(20,9)