Y
Y
YuriyCherniy2019-09-29 13:34:34
Python
YuriyCherniy, 2019-09-29 13:34:34

How to calculate 9**(9**9) without spending a huge amount of time on it?

How can Python handle such large numbers when exponentiated? The final task is educational, it is necessary to return the last digit of the calculated number.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2019-09-29
@YuriyCherniy

Algorithm:

  1. pen write on paper the first few degrees 9
  2. an idea pops up in my head

X
xmoonlight, 2019-09-29
@xmoonlight

Even 2 digits:
(9+20(N-1))%100 - odd
abs(101-20N)%100 - even

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question