Demo entry 6771736



Submitted by anonymous on Nov 20, 2018 at 08:26
Language: Python 3. Code size: 493 Bytes.

def factorial(n):
    prod = 1
    for i in range(1,n):
    return prod

def combination(n,k):
    return factorial(n)//(factorial(k)*factorial(n-k))

def permutation(n,k):
    return factorial(n)//factorial(k)

def letter_eq(n):
    total = 0
    for i in range(n+1):
        total += (-1)**i * combination(2*n-i,i) * \
            permutation(n,n-i) * factorial(2*n-2*i)//2**(n-i)
    return total

if __name__ == '__main__':

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).