Zigzag array with odd number

So here is the deal, I wan’t to make a zigzag pattern with odd number only using one object and not duplicating it and setting it below or above the original object and adding an array modifier to that object and setting a lower number of copies. Here is an example of what I’ve done so far


and what I need
note that in this picture I’ve applied the modifier and deleted one object or circle in this case, but that is not what I need. I must use only one object and some modifier, less objects more UV space that’s my moto. Anyway, is there a trick I can solve this puzzle?

So to put it in a more simpler way I need to make a pyramid from one cube like in this picture


using an array or any other modifier(that I can later change depending on my need) that will give the desired result. So is it possible, is there a way to do this?

You may not get to your single object goal without some python. But I can get you pretty close (see attachment). Your arrayed object is still limited to being even, but you just toggle the end cap in the modifier to get that last “zig” in your zig zag to make it odd. This way is at least non-destructive so you can edit on the fly later.

Attachments

odd_array.blend (475 KB)

Thanks man, this was an interesting example of doing it. I’m gonna use this trick sometime in the future. You are of great help.