@cacheit
def _nT(n, k):
 if (k == 0):
  return (1 if (k == n) else 0)
 return sum((_nT((n - k), j) for j in range((min(k, (n - k)) + 1))))

@ cacheit def _nT ( n , k ) : if ( k == 0 ) : return ( 1 if ( k == n ) else 0 ) return sum ( ( _nT ( ( n - k ) , j ) for j in range ( ( min ( k , ( n - k ) ) + 1 ) ) ) )
return the partitions of n items into k parts .