Processing math: 100%

n_compositions Function

public elemental function n_compositions(k, n) result(res)

Return the number of compositions for k summands and a sum of n

A composition is a solution to the integer equation n=x1+...+xk with xi,nN0,kN.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: k
integer, intent(in) :: n

Return Value integer(kind=int64)


Contents