How to construct a discrete circuit to send out a square wave with N pulses?
Thinking outside the box:

An astable multivibrator that has a diode and cap on the output. When the pulse is high it charges the cap a little bit.  After N pulses the voltage will reach a threshold which is detected by a comparator, and that disables the multivibrator.

You'll need a method to reset it by discharging C1 as well.

Here is a conceptual diagram:







simulate this circuit &ndash; Schematic created using CircuitLab