Calculate binomial coefficient based on Pascal's triangle