Answer the question
In order to leave comments, you need to log in
What does "modulo m" mean?
Hello.
There is a task that is basically clear:
Let's call the value of the expression 2^2^n the nth superpower of the number 2. Thus, for example, the third superpower of the number 2 is 2^2^3 = 2^8 = 256.
Your task is to calculate the nth superpower of two modulo m.
Answer the question
In order to leave comments, you need to log in
https://ru.wikipedia.org/wiki/%D0%A1%D1%80%D0%B0%D...
"modulo m" is about the same as "remainder of division by m"
Remainder of the division. In general, this is done at school, the elementary foundations of number theory.
Here it was "kosherly inflated"
https://brestprog.by/topics/modulo/
In some tasks there is a condition of the following form: “print the remainder of dividing the answer by 1000000007” or “print the answer modulo 1000000007”. This does not mean that you need to calculate the answer in the usual way and output ans % 1000000007. The answer in such problems is often so huge that it is difficult to represent it even with long arithmetic. To solve them, you need to make changes to all intermediate calculations so as not to go beyond the boundaries of the integer type.
We can say that in such problems we operate not with numbers, but with their remainders after division by 1000000007. This is possible due to the following properties of calculations with a remainder:
(a+b)modm=((amodm)+(bmodm))modm(a−b)modm=((amodm)−(bmodm))modm(ab)modm=((amodm)∗(bmodm))
modm Thus, we can perform the three most important mathematical operations, even without knowing the exact values of numbers, only their remainders after dividing by a given number (modulus). Division is a separate topic, which we will discuss later.
Without delving into the definitions of terms from higher mathematics, operations with remainders from division by a modulo are called operations in a modulo field, and the remainders themselves are modulo numbers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question