Example #1
0
def calculate():

    count = 0

    for x in range(1, 101):
        for y in range(1, x+1):
            if(euler.ncr(x, y) > 1000000):
                count += 1

    return str(count)
Example #2
0
def pascal(rows):
    return [euler.ncr(rows, i) for i in range(rows + 1)]
Example #3
0
def pascals_triangle(rows):
    for i in xrange(rows):
        yield [euler.ncr(i, j) for j in xrange(i + 1)]
Example #4
0
from euler import ncr

limit = 1000000

c = 0
for n in range(1, 101):
    for r in range(1, n + 1):
        if ncr(n, r) > limit:
            c += 1
print c
Example #5
0
def pascals_triangle(rows):
    for i in xrange(rows):
        yield [euler.ncr(i, j) for j in xrange(i+1)]
Example #6
0
def pascal(rows):
    return [euler.ncr(rows, i) for i in range(rows + 1)]