Generation

generate functionSat, 28 Jan 2023

x=4**2022-6*4**522+5*64**510-3*2**330-100 x is translated into the number system with the base 8. Determine the number of digits "7" in the record of this number

from math import log def f(x): return int(log(x, 8)) + 1 def f1(x): return x % 8 def f2(x): return int(x / 8) def g(x): if x < 8: return 0 else: return g(f2(x)) + f1(x) g(f(4**2022-6*4**522+5*64**510-3*2**330-100))

Questions about programming?Chat with your personal AI assistant