from scipy.stats import binom
n = 500
while binom.cdf(n//3, n, 1/6) >= 0.99:
    print('n = {} ; proba = {}'.format(n,binom.cdf(n//3, n, 1/6)))
    n -= 1
