def binomial_coefficients(n):
 d = {(0, n): 1, (n, 0): 1}
 a = 1
 for k in range(1, ((n // 2) + 1)):
  a = ((a * ((n - k) + 1)) // k)
  d[(k, (n - k))] = d[((n - k), k)] = a
 return d

def binomial_coefficients ( n ) : d = { ( 0 , n ) : 1 , ( n , 0 ) : 1 } a = 1 for k in range ( 1 , ( ( n // 2 ) + 1 ) ) : a = ( ( a * ( ( n - k ) + 1 ) ) // k ) d [ ( k , ( n - k ) ) ] = d [ ( ( n - k ) , k ) ] = a return d
return a dictionary containing pairs :math:{ : c_kn} where :math:c_kn are binomial coefficients and :math:n=k1+k2 .