I prefer to do that this way.

This commit is contained in:
cedricbonhomme 2011-12-30 19:47:23 +01:00
parent e3d2fbd6e9
commit 62316f10c1

View file

@ -40,10 +40,10 @@ def OEIS_A000217():
http://oeis.org/A000217
Triangular numbers: a(n) = C(n+1,2) = n(n+1)/2 = 0+1+2+...+n.
"""
n = -1
n = 0
while True:
n += 1
yield (n*(n+1))/2
n += 1
def fermat():
"""