So, I have an four numbers.
There is they are:
Number 1 is
40008260280899465341031700284668165694305281399205262735419849961365494809955
Number 2 is
82350526090533023720340378009795932810949001557338040412858442884672237587320
Number 3 is
115792089237316195423570985008687907853269984665640564039457584007908834671663
Number 4 is
0
I must calculate an fourth number, which at the moment equals to zero.
To do that, I must perform four steps of math operations.
1. Multiply Number 1 by Number 1
The result of this step will be:
1600660890704197765354479495339625405951583926360287119453582016817491244540713053191394166818590707196837509107255928642787944538394204779614041567102025
2. Subtract Number 2 from number given at step 1
The result of this step will be:
1600660890704197765354479495339625405951583926360287119453582016817491244540630702665303633794870366818827713174444979641230606497981346336729369329514705
3. Subtract Number 2 from number given at step 2
The result of this step will be:
1600660890704197765354479495339625405951583926360287119453582016817491244540548352139213100771150026440817917241634030639673268457568487893844697091927385
4. Find a remainder of division (result of step 3) / Number 3
The result of this step will be:
57596313968696056513592514942606311130102873379708317985822131243580561204901
Result of #4 will be Number 4.
Can I get result of #4 in some way, where none of results steps will be greater than:
115792089237316195423570985008687907852837564279074904382605163141518161494337
Is it possible to get this result but using only simple arithmetic functions?
Like addition, subtraction, multiplication, division, ...?
UPD.: I'm tried @paul-sinclair answer. If I'm correct, I must perform following steps:
step1 = n1 mod n3
step2 = n2 mod n3
step3 = step1 * step1
step4 = step2 * 2
step5 = step3 mod n3
step6 = step5 - step4
step7 = step6 mod n3
It gives right result, but step3 gives very big number, greater than written above.
Modular arithematic: the remainder from dividing $a$ by $n$ is denoted by $a \mod n$ (this is a comp science notation by the way - mathematicians generally use "mod" a bit differently). The thing is the remainder is fairly well behaved (Edited to add Lubin's correction): $$(a + b) \mod n = (a \mod n) + (b \mod n) \mod n$$ $$ ab \mod n = (a \mod n)(b \mod n) \mod n$$ etc. So your problem is to find $ n_1^2 -2n_2 \mod n_3 $.
The trick is to take the remainder first: $$ n_1^2 -2n_2 \mod n_3 = \left ( (n_1 \mod n_3)^2 \mod n_3 - 2(n_2 \mod n_3) \right ) \mod n_3$$
That is, at each point as soon as any intermediary calculation raises above $n_3$, we take the remainder $\mod n_3$ again to make it smaller. Because of how remainders work, this will give the same answer in the end.