! Factorial
function fact(n)	!integer

fact =1
if(n==0) return

do i =1, n
fact =fact*i
enddo
END

! Aranjamente/Permutations (n.k)
function perm(n,k)

if(k==0) then
perm =1
RETURN
endif

perm =n

do j =1, k-1
perm =perm*(n-j)
enddo

end

! Combinari
function comb(n,k)

!combin =fact(n)/(fact(k)*fact(n-k))
comb =perm(n,k)/fact(k)

end
