Well this problem only have solution if we made 2 assumptions (otherwise there is infine combinations)
1) the smalest square has a fixed size
2) the way to cut the big square is also fixed, as if you put the square into a grid which lines are separated by the size of the small square.
There is also an third assumption that would make the problem a bit easier
3) The big square has side K-times bigger than the small square. With K being an integer.
If both assumptions are true we can proceed:
Find the number of N (N beign integer) smallest squares: squares with size N*small-size
if ((big-size % N*small-size)==0)
Number += (big-size / N*small-size)^2
else
Number += ((big-size / N*small-size)^2) * (big-size % N*small-size)
The * (big-size % N*small-size) in the else condition is there becouse if the bigsquare isn't divided by N, when "griding" the big square with gid-width of N, we will have an "fraction part" left. This way we can start dividing again (griding again) but with an offset of 1, 2 or N small steps. The amount of steps is (big-size % N*small-size).
Again, these steps only hold true if the 3 assumptions were took.