HabKaffee

Untitled

Dec 5th, 2021
573
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def func(num, base):
  2.     num_copy = num
  3.     num_str = ''
  4.     while num > 0:
  5.         num_str += str(num % base)
  6.         num //= base
  7.     num_str = str(num_copy % base) + num_str
  8.     R = 0
  9.     for i in range(len(num_str)):
  10.         R += int(num_str[i])*(base**i)
  11.     return R
  12.  
  13. for i in range(1, 10000000):
  14.     res = func(i, 3)
  15.     if (res >= 1000) and (res < 10000):
  16.         print(res)
  17.         break
  18.    
  19.  
RAW Paste Data