mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-13 09:28:31 +02:00
Added generator for OEIS:A000217 (http://oeis.org/A000217">A000217).
This commit is contained in:
parent
03e35037cc
commit
e3d2fbd6e9
1 changed files with 10 additions and 0 deletions
|
@ -35,6 +35,16 @@ def identity():
|
||||||
yield n
|
yield n
|
||||||
n += 1
|
n += 1
|
||||||
|
|
||||||
|
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
|
||||||
|
while True:
|
||||||
|
n += 1
|
||||||
|
yield (n*(n+1))/2
|
||||||
|
|
||||||
def fermat():
|
def fermat():
|
||||||
"""
|
"""
|
||||||
Generate the n-th Fermat Number.
|
Generate the n-th Fermat Number.
|
||||||
|
|
Loading…
Add table
Reference in a new issue