polymerist.maths.combinatorics.tables

Tabular and printable forms of collections of combinatorial numbers

Functions

pascal(→ str)

Generate a printable string of the first N rows of Pascal's triangle

Module Contents

polymerist.maths.combinatorics.tables.pascal(N: int) str[source]

Generate a printable string of the first N rows of Pascal’s triangle

Parameters:

N (int) – Number of rows to print

Returns:

pascal_string – A string consisting of each row of Pascal’s triangle, center-justified and separated by newline characters

Return type:

str