It would have to lift its mass at least 40000 kilometers
This doesn't make a whole lot of sense. On Earth, a space elevator needs to have that sort of length because it needs to reach out to the geosynchronous point plus a bit more to the counterweight. A space fountain can be of more or less arbitrary size, which means you only need to build it long enough to be comfortably clear of the atmosphere and facilitate a rocket launch more easily than if you took off from the ground. On Earth, for example, if you could launch your rocket from the top of a tower at a few hundred kilometres altitude you wouldn't have to fight atmospheric drag or gravity drag, you wouldn't need substantial payload fairings and careful aerodynamic streamlining, etc etc. 4000km seems pretty excessive for a space fountain. 40000km is ludicrous.
There are other dynamically-supported megastructures suitable for spacelaunch which are smaller than that. The Lofstrom Loop is about 2000km long. A 40000km loop would be almost enough to make a complete dynamic orbital ring around Earth at a few hundred kilometres altitude, which is a far more useful device than a space fountain (and far harder to build). That latter paper, by Paul Birch, is worth a read, and I'll reference it a few times below.
For the altitude though, I'll assume you just hit the 0 key too many times.
At 400km, the force of Earth's gravity is about 8.67N/kg, which is the force the fountain must oppose. You can view the fountain as a continuous stream of momentum $p$, imparting $2p$ per second to the top of the fountain. $p$ is therefore ~17.35kgm/s per kilogram of station it supports. This can be imparted by small masses going fast, or large masses going slowly.
Each discrete chunk of the fountain stream is on a ballistic trajectory, shot out of some accelerator at the bottom. It must have momentum $p$ at the station's altitude (again, using 400km). Lets assume the projectile travels for its entire trajectory in a vacuum (to avoid drag losses) and is travelling on a parabola (which isn't quite right, but it'll do for now).
I'll ignore the reduced force of gravity at altitude for now, to simplify things (which will make my answer more pessimistic; in reality gravity losses will be lower so the projectile can travel slower). Vertical displacement of a ballstic projectile is $y = v_0t - \frac{gt^2}{2}$ where $v_0$ is the initial projectile upward velocity, $t$ is the time after launch and $g$ is the acceleration due to gravity. Projectile velocity is $v = v_0-gt$. For a 1kg projectile, $v_0 = 17.35+gt$ and as we want a projectile velocity of 17.35m/s at a height of 400km, we get a nice quadratic to solve to find out when that occurs in the trajectory: $17.35t + \frac{gt^2}{2} - 400000 = 0$ giving us a $t$ of ~284s and hence a $v_0$ of ~2.8km/s, which is Quite Fast... faster than modern day experimental railguns, to give you an idea of the tech-level here. This is probably a low-end estimate; to reduce the sheer amount of metal you have flying through the air you'll probably want faster projectiles. This should also give you some idea of the accuracy you'll need for your projectile launch system, and hence how big the receiver apparatus (a big funnel made of electromagnetic coils) on the station will end up being so that all incoming projectiles were caught.
You'll need a fairly powerful device to accelerate your fountain projectiles. A coilgun is probably a good choice, as it doesn't need to contact the projectiles and so there will be no wear issues when the thing is in operation. It doesn't really matter how long this accelerator is (except to the people paying for the thing, but they're not part of this specific problem), so all we need to do is a) boost each projectile up to speed and b) do so without heating it up too much. It has nearly five minutes to radiate away excess heat on its trip up, so we don't have to worry too much about (b).
Note that powering the accelerator isn't quite as bad as it might first seem, because falling projectiles will be travelling at more or less the same speed as they were fired, so with a suitably clever set of steering coils you can bend their trajectory around and back into the accelerator which will only need to top up their velocity to the required 2.8km/s rather than accelerate every projectile to that speed from stationary every time.
The projectiles are likely to be smallish; there's no need for bigger projectiles unless you're limited by the capabilities of your accelerator, and at <3km/s there's plenty of scope for faster projectiles with fairly modest science-fictional technology requirements. The projectile stream therefore won't affect the diameter of the tower very much.
You definitely do not want to have to shoot your projectiles through the atmosphere, because they'll lose masses of energy through drag, they'll be damaged, they'll heat up, they'll be nudged off-course and so on. You'll need to fire them through an evacuated tube up to some point where air density is negligible. On Earth, one definition of the edge of space is the Kármán line, which is ~100km up. Air density is 2 million times less than at sea level, which will do. This is obviously too high for a self-supporting structure, and too high even for a structure bouyed up by balloons. That's OK though, because we have two options for supporting the vacuum tube.
One is to hang it from cables dangling from the top station. Strong cables a few hundred kilometres long are entirely practical things, without even the need for fancy carbon nanotube supermaterials (though they'd make things lighter and stronger, of course). The "Jacob's Ladders" in Birch's orbital rings paper can be made of kevlar or glass fibres or even steel if they're a mere 300-600km long, though the latter is likely to be impractically heavy. Materials technology may also have marched on a bit in the ~40 years since the paper was originally written!
The other is to have the projectile stream itself hold up the tubes. The tubes can be built with parasitic magnetic coils in them that sap a little of the momentum of passing projectiles to support their own weight. Obviously this will need an even more powerful fountain to support both the top station and the vacuum tube. In the limit of course, the tubes could be held up by their own set of space fountains at a more manageable 100km long, making them a simpler engineering operation than the main affair.
The top of the tube would be a good place to have some steering coils to correct any inaccuracies.
In any case, supporting the tubes needn't be a problem.
Birch has considered wind and weather effects on vertical tubular structures and came to the conclusion that even a 3m wide tube would be just fine, and not subject to excessive wind-driven wobbles, which is good, given that if the tube was deflected harder and faster than it could be corrected by magnetic interaction with the fountain stream, the whole thing would explode in a horrible mess. A three metre wide tube should therefore allow some wiggling of the tube, and some inaccuracy of aiming without being too big or implausibly difficult to engineer. You might get away with skinnier structures if your pointing ability was good enough.
The StarTram project, another non-rocket assisted spacelaunch megastructure, also uses vacuum tubes to contain the launched spacecraft in the thick lower atmosphere. They have an electromagnetically levitated tube with a 3m internal diameter (bigger than needed here, most likely) and ~240km long, which is more than long enough for your needs here. They too looked at movement of the tube caused by high-atmopshere winds, and came to the conclusion that the deflection in that case was small enough to be easily taken care of by the electromagnetic levitation system. Of course, pointing errors with the StarTram don't involve hosing down your top station with tonnes of projectiles. The top of a space fountain would therefore need some kind of active stationkeeping system via rockets, and radar observing the projectile stream below to ensure that things don't become unstable or unsafe, and the emission system at the bottom will similarly need to be steerable to some degree.
Irritatingly, the papers I have on it do not discuss the weight of the levitated section of the StarTram tube, so I'll keep hunting for that. This paper seems like it might be relevant: StarTram: Ultra Low Cost Launch For Large Space Architectures but I'm not so keen to read it that I'm going to pony up $30 for the privilege. Donations welcome, though ;-)