Algorithms(see below for more info) which is the main focus come under maths and as it is a procedure of formula for solving a problem. The formula used to solve a rubiks cube can be studied to see the pattern on certain way this set of steps manage to piece the rubiks cube into the colours nicely. Also the angle of which we turn the cube will affect our result significantly.

Number patterns—such as 3, 6, 9, 12—are familiar to us since they are among the patterns we first learn as young students. As we advance, we experience number patterns again through the huge concept of functions in mathematics. But patterns are much broader. They can be sequential, spatial, temporal, and even linguistic.

Other topics such as indices can be used to simplify and calculate the permutations of the cube. Inequalities complement indices to help us in calculating the inequalities while a special formula can also help us in calculating the possible directions a cube can be twisted and turned.

Probability give you an idea of the chances of you making the correct move.

__More about algorithms__
Number patterns—such as 3, 6, 9, 12—are familiar to us since they are among the patterns we first learn as young students. As we advance, we experience number patterns again through the huge concept of functions in mathematics. But patterns are much broader. They can be sequential, spatial, temporal, and even linguistic.

In a curious way there is place where logic, math and algorithms meet in a very specific way. It's called the Curry-Howard isomorphism.

First programming:

Suppose we have a statically types programming language like Java. We might have an object of type `X` defined by a line of code in a language like C# (say)We might also have a function taking arguments of type `X` and returning things of type `Y`.

As shorthand we can say `f` is of type `X -> Y`. The stuff before the arrow is the argument to `f` and the stuff after is the return type.

Given an object of type `X`, and a function of type `X -> Y`, we can make an object of type `Y` by applying `f` to `X`.

Adapted from http://www.quora.com/What-are-the-relationships-between-logic-math-and-algorithms

Second, logic:

Suppose `X` is a proposition we have proved. Suppose also we have managed to prove that `X` implies `Y`. We can write the implication as `X -> Y`. And now we have almost the same statement as before: given a proof of `X` and a proof of `X -> Y` we get a proof of `Y`.

Third, mathematics:

Suppose `x` is in some set `X`. Suppose we have a function `f:X->Y`. Then we can construct an element of the set `Y` simply by applying `f` to `X` giving `f(x)`.