Create 6 - Hailstone

This commit is contained in:
Lukas Baumann 2021-02-17 13:01:44 +01:00 committed by GitHub
parent 60963afc29
commit 4bdca34c81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
16/6 - Hailstone Normal file
View File

@ -0,0 +1,5 @@
def hailstone(n):
print(n)
if n != 1:
if n%2: hailstone(3*n+1)
else: hailstone(n//2)