This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# コラッツ予想 | |
# コンソールアプリ | |
def collatz(v): | |
if v % 2 == 0: | |
return int(v / 2) | |
else: | |
return v * 3 + 1 | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 数年ぶりの Python. | |
# ついでだし Python3 でやってみたログ。 | |
# 2,8,10 進数で回文を探す | |
def is_int_kai(num): | |
v = str(num) | |
rev = v[::-1] | |
return v == rev | |