suve

awful: function: newt

Declaration

int :newt ( int $N , int $K )

Summary

Returns the value of Newton's Symbol (binomial coefficient) N over K.

Example

# :newt example
:writeln :newt i9 i0    # Should be 1
:writeln :newt i9 i3    # Should be 84
:writeln :newt i9 i5    # Should be 108
:writeln :newt i9 i6    # Should be 84
:writeln :newt i9 i9    # Should be 1
:writeln :newt i9 i15   # Should be 0

wikistrona zmodyfikowana 2014/0601/2317