The pattern followed in numbering the squares is such that, each number of squares is added to itself and then two squares are added at the edge of it, one square at either end.
Hence, one square would be
1 = 1 + 1 + 2
2 = 2 + 2 + 2
And so on
This can be expressed in algebraic form as follows;
When x is the number given, the number of squares in it becomes
x = x + x +2
x = 2x + 2
So if x is 50, then the number of squares is now,
x(50) = 2(50) + 2
x(50) = 100 + 2
x(50) = 102
Therefore in figure 50 you have 102 squares.