How do you translate this for math in a loop

I am trying to solve what seems like a simple math problem. I can write the problem as a for loop, but I'm not sure how to translate it into an equation. Can anyone help?

x = 10;
for(int i=0; i<3000; i++)
{
    x = x^2
}
+5
source share
6 answers

x ^ (2 ^ 3000) where ^ means power

+10
source

You provided the code and ask us to provide the mathematical equivalent - so I'm going to take your code literally and consider it a C-like language.

In this environment, ^ is a bitwise XOR operator. So, after the cycle x = 10, since it was XOR-ed with a constant of 2 (switching bits of the next least significant bit) an even number of times.

- ?

+6
for(int i=0; i<n; i++)
    x = x^p

:

x = x^(p^n)
+4

, , . A n A n-1, A n-2 .. ,

A n= A n-1 2

, Mandelbrot set.)

+4

- ( 10 ) 3000 .

0

, ,

x = 10000000... (etc.)

But I suspect you want something more intensional:

x = 10^6000

Or even more:

x = (10^2)^3000

Or (if you allow slightly weaker notation):

x = (10^2) ... ^2

with horizontal "} 3000" under "...".

-3
source

All Articles