jusohatam

Untitled

Sep 29th, 2020
547
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def solution(n):
  2.     while n // 10 > 0:
  3.         n = sum(int(i) ** 2 for i in str(n))
  4.     if n == 1:
  5.         return True
  6.     return False
  7.  
  8.  
  9. n = int(input())
  10. print(solution(n))
  11.  
RAW Paste Data