diff options
Diffstat (limited to 'progs/a663.py')
-rw-r--r-- | progs/a663.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/progs/a663.py b/progs/a663.py new file mode 100644 index 0000000..7130b51 --- /dev/null +++ b/progs/a663.py @@ -0,0 +1,7 @@ +def count_binary_seq(n):
+ nCr = 1
+ res = 1
+ for r in range(1, n + 1):
+ nCr = (nCr * (n + 1 - r)) / r
+ res += nCr * nCr
+ return res
\ No newline at end of file |