Love丶FFC's Blog
卡拉兹(Callatz)猜想:
对任何一个正整数 n,如果它是偶数,那么把它砍掉一半;如果它是奇数,那么把 (3n+1) 砍掉一半。这样一直反复砍下去,最后一定在某一步得到 n=1。卡拉兹在 1950 年的世界数学家大会上公布了这个猜想,传说当时耶鲁大学师生齐动员,拼命想证明这个貌似很傻很天真的命题,结果闹得学生们无心学业,一心只证 (3n+1),以至于有人说这是一个阴谋,卡拉兹是在蓄意延缓美国数学界教学与科研的进展……
我们今天的题目不是证明卡拉兹猜想,而是对给定的任一不超过 1000 的正整数 n,简单地数一下,需要多少步(砍几下)才能得到 n=1?
每个测试输入包含 1 个测试用例,即给出正整数 n 的值。
输出从 n 计算到 1 需要的步数。
3
5
1.while循环
Number = int(input()) Count = 0 while Number != 1: if Number % 2 == 0: Number /= 2 else: Number = (3 * Number + 1) / 2 Count += 1 # Number!=1时都需要砍一刀 print(Count)
fruinly
is there a generic cialis available Baseline physical and lab assessments enable nurse to compare changes in liver function and thyroid function
FoorryNox
buy cialis 5mg online Results Enteric glia express MHC II molecules in response to a subclinical dose of interferon Оі and lipopolysaccharide in vivo
cheap louis vuitton
Read reviews and was a little hesitant since I had already inputted my order. otherwise but thank god, I had no issues. decline received item in a timely matter, they are in new condition. regardless so happy I made the purchase. Will be definitely be purchasing again.
cheap louis vuitton https://www.louisvuittonsoutletstore.com/
cheap jordans for sale
Read reviews and was a little hesitant since I had already inputted my order. as but thank god, I had no issues. themselves received item in a timely matter, they are in new condition. no matter what so happy I made the purchase. Will be definitely be purchasing again.
cheap jordans for sale https://www.cheaprealjordan.com/
cheap jordans for sale
Read reviews and was a little hesitant since I had already inputted my order. or perhaps a but thank god, I had no issues. most notably the received item in a timely matter, they are in new condition. you decide so happy I made the purchase. Will be definitely be purchasing again.
cheap jordans for sale https://www.realjordansretro.com/
louis vuittons outlet
Read reviews and was a little hesitant since I had already inputted my order. also but thank god, I had no issues. choose to received item in a timely matter, they are in new condition. manner in which so happy I made the purchase. Will be definitely be purchasing again.
louis vuittons outlet https://www.louisvuittonsoutletonline.com/
Preliaf
15_suppl May 20, 2008 537 537 buying cialis online forum The nursing staff was very kind and patient with me