mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-13 01:18:31 +02:00
Bugfix in Syracuse sequence.
This commit is contained in:
parent
98bebe3117
commit
8c51a96cf9
1 changed files with 3 additions and 3 deletions
|
@ -108,9 +108,9 @@ def syracuse(l=15):
|
||||||
def syracuse_gen(n, l=15):
|
def syracuse_gen(n, l=15):
|
||||||
if n == 0:
|
if n == 0:
|
||||||
return l
|
return l
|
||||||
if n % 2 == 0:
|
if syracuse_gen(n-1) % 2 == 0:
|
||||||
return syracuse_gen(n-1)/2
|
return syracuse_gen(n-1)/2
|
||||||
elif n % 2 == 1:
|
elif syracuse_gen(n-1) % 2 == 1:
|
||||||
return 3*syracuse_gen(n-1)+1
|
return 3*syracuse_gen(n-1)+1
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue