Basic check for perfect squares, cubes etc up to certain dimension.