kyu_6.easy_diagonal package¶
Submodules¶
kyu_6.easy_diagonal.diagonal module¶
-
kyu_6.easy_diagonal.diagonal.
diagonal
(n: int, p: int) → int[source]¶ We want to calculate the sum of the binomial coefficients on a given diagonal. The sum on diagonal 0 is 8 (we’ll write it S(7, 0), 7 is the number of the line where we start, 0 is the number of the diagonal). In the same way S(7, 1) is 28, S(7, 2) is 56.
- Parameters
n – n is the line where we start and
p – p is the number of the diagonal
- Returns
the sum of the binomial coefficients on a given diagonal