When you posted your question about the pyramid, I actually had an object more like this in mind:
So I came up with something different, this is not an answer to your original question but since you said the point of this exercise is to expand your knowledge on Geometry Nodes, I thought I'll just leave it here.
My idea was to start with a square base where I can set the number of blocks for one side which I can set as input parameter. The width/length should be the same as the height and are controlled by an input parameter as well (that's width/length/height of the points where the blocks are placed not the dimension overall).
I had a Quadrilateral as base being instanced upwards on a Curve Line and scaled down towards the top. Then building upwards I wanted each layer of blocks to have one block less per side than the layer below. I achieved this with using the index of the instances as counter.
Then I just had to use cubes for the pyramid blocks, adjust their size according to how many rows there are overall and at the end I moved them up a little to sit on the floor plane. I'm not going to explain it all since this is not even an answer to the question, but here's the node setup and at the end I'll upload the file. I'm sure this can be optimised somehow:
Playing with the size and number of blocks you can adjust the pyramid to your liking:
And here's the file: