From 15bdf848b6002e1769d87a1fe0c3eece7c51418d Mon Sep 17 00:00:00 2001 From: sairate Date: Fri, 12 Jul 2024 17:12:53 +0800 Subject: [PATCH] Signed-off-by: sairate --- 角谷猜想.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 角谷猜想.py diff --git a/角谷猜想.py b/角谷猜想.py new file mode 100644 index 0000000..8190356 --- /dev/null +++ b/角谷猜想.py @@ -0,0 +1,13 @@ +def jiaogu(n): + if n==1: + print("END") + return 1 + if n%2==0: + print(n,"/",2,"=",n//2,sep="") + jiaogu(n//2) + else: + print(n, "*", 3, "+",1,"=", n*3+1, sep="") + jiaogu(n*3+1) + +n=int(input()) +jiaogu(n) \ No newline at end of file