Rubik's cube function I'm thinking in a function and if it's possible to solve that.
I have been playing with the cube using the following move: $R U L' U'.$
I notice that the cube solves itself with a certain number of moves: 28 moves to $2\times2\times2$ and 112 to $3\times3\times3.$ (If the cube already is solved).
Then I'm trying to create a formula to calculate the number of moves for the another cubes like $4\times4\times4, 5\times5\times5, 6\times6\times6\dots$
Since:

$x \rightarrow y$
$1 \rightarrow 0$
$2 \rightarrow 28$
$3 \rightarrow 112$
$4 \rightarrow z$

Where x is the number of the cube $(2 = 2\times2\times2, 3 = 3\times3\times3 \dots)$ and y is the amount of moves, I came up with two formulas: 28*$((x-1)^{(x-1)})$ and 28*$(x-1)^2$. Thus, the value for $z$ could be 252 or 756,
My questions are:


*

*Are any of these formulas correct? If so, which one?

*Can be my reasoning corret about the formulas?

*If I'm wrong, answer me why!

 A: Have you tried it on a $4\times4\times4$ cube?  If not there are online rubiks cubes you can play around with.
But to answer your question my guess is that for any cube size $3$ and up you'll solve it again in $112$ moves.  That is because R U L' U' doesn't touch any of the "inner" edges so that means larger cubes will all behave like a $3\times3\times3$ cube in this case.
A: The answer for a $4 \times 4 \times 4$, $5\times 5\times 5$, and so on cube will continue to be $112$.
Here's why. Imagine that you take an $n \times n \times n$ cube and, on each face, glue the pieces in the middle $(n-2) \times (n-2)$ square together, so they cannot be separated. Similarly, glue the middle $n-2$ pieces along each edge together. What you have is no longer an $n \times n \times n$ cube, but a $3 \times 3 \times 3$ cube in which some of the pieces are much larger in size. But it still operates exactly like a $3 \times 3 \times 3$ cube and affords exactly the same twists.
Your repeated RULU' move is acting on the $n \times n \times n$ cube in a way that gluing the pieces as above doesn't forbid. So whatever happens on the $n \times n \times n$ cube for $n>3$ is exactly the same as what happens for the $3 \times 3 \times 3$ cube.
The only reason that the $2 \times 2 \times 2$ cube is an exception is that here, there are no "edge" pieces at all. So if a sequence of moves in the $3 \times 3 \times 3$ cube scrambles (or flips) the edges but leaves the corners fixed, then on the $2 \times 2 \times 2$ cube, it does nothing, and this exactly describes what $28$ iterations of RULU' do.
A: What if the middle squares in a $4\times4\times4$ are scrambled?
Here's a couple more resources to help you with your mathematical journey. A full analysis of the Rubiks Cube, based on a 2-week long summer Research Experience for Undergraduates, can be found here. In particular, you found what's called a group generator. The number of steps is the order of the group element (distinct from the order of the group itself). 
