mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-13 01:18:31 +02:00
Minor changes in comments.
This commit is contained in:
parent
ab0e7abf00
commit
94e3112189
1 changed files with 10 additions and 3 deletions
|
@ -28,7 +28,7 @@ import itertools
|
||||||
|
|
||||||
def fermat():
|
def fermat():
|
||||||
"""
|
"""
|
||||||
Return the n-th Fermat Number.
|
Generate the n-th Fermat Number.
|
||||||
"""
|
"""
|
||||||
n = 0
|
n = 0
|
||||||
while True:
|
while True:
|
||||||
|
@ -37,7 +37,7 @@ def fermat():
|
||||||
|
|
||||||
def mersenne():
|
def mersenne():
|
||||||
"""
|
"""
|
||||||
Return 2^k-1.
|
Generate 2^n-1.
|
||||||
"""
|
"""
|
||||||
n = 0
|
n = 0
|
||||||
while True:
|
while True:
|
||||||
|
@ -59,7 +59,9 @@ def eratosthenes():
|
||||||
yield i
|
yield i
|
||||||
|
|
||||||
def eratosthenes_composite():
|
def eratosthenes_composite():
|
||||||
""" Generate the composite numbers with the sieve of Eratosthenes. """
|
"""
|
||||||
|
Generate the composite numbers with the sieve of Eratosthenes.
|
||||||
|
"""
|
||||||
p1 = 3
|
p1 = 3
|
||||||
for p2 in eratosthenes():
|
for p2 in eratosthenes():
|
||||||
for n in range(p1 + 1, p2):
|
for n in range(p1 + 1, p2):
|
||||||
|
@ -75,6 +77,9 @@ def carmichael():
|
||||||
yield m
|
yield m
|
||||||
|
|
||||||
def ackermann(m, n):
|
def ackermann(m, n):
|
||||||
|
"""
|
||||||
|
Ackermann number.
|
||||||
|
"""
|
||||||
if m == 0:
|
if m == 0:
|
||||||
return n + 1
|
return n + 1
|
||||||
elif n == 0:
|
elif n == 0:
|
||||||
|
@ -85,6 +90,8 @@ def ackermann(m, n):
|
||||||
def fibonacci():
|
def fibonacci():
|
||||||
"""
|
"""
|
||||||
A generator for Fibonacci numbers, goes to next number in series on each call.
|
A generator for Fibonacci numbers, goes to next number in series on each call.
|
||||||
|
This generator start at 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, ...
|
||||||
|
See: http://oeis.org/A000045
|
||||||
"""
|
"""
|
||||||
a, b = 1, 2
|
a, b = 1, 2
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Add table
Reference in a new issue