Geometric proof of an algebraic formula

In a friendly chat I saw an idea for a nice toy. It's a well-known thing, and you can check the post with a magnificent picture, and a beautiful site with a lot of deep facts from math, physics, geometry and engineering.

I haven't printed anything for a while, so I opened Blender and created a model from scratch. Actually, two models. The first one used 5 scaled cubes, later joined together. The second one used one cube as a starting point: I stretched it and then extruded these terraces. If you want to see a short video on how to create such models in Blender from scratch, please press the pumpkin emoji.

Then I printed the model, and the funniest part started. You can use three pyramids to create a slab with a ridge on one side. Six pyramids make two ridged slabs. Move them together - and you have one slab. Each pyramid contains x terraces with unit height. So, the volume of this pyramid is 11 + 22 + 33 + ... + xx. Six pyramids give you a slab with sides x, x + 1, 2*x + 1 (check the picture). And finally:

11 + 22 + ... + xx = x * (x + 1) * (2x + 1) / 6

One thing bothers me. The sum of squares on the left side is clearly an integer. But there is a fraction on the right side of the equation. What if for some x it is not an integer? Please share your thoughts on this subject.