Knowing that a circle is...
x2 + y2 = r2
And that r will increase faster and faster as I go up in Z-levels. After some googling, a Gaussian function will do nicely. The textbook "bell curve" function.
Let's focus on the radius only, putting what's above aside for the moment. Since the radius will increase as per a Gaussian function, the formula of which shall be:
r = a(-((Z-b)2/(2c2)))
Solving for Z-level #1, I get:
r = a(-((1-b)2/(2c2))) ≈ 9
Solving at Z-level #40, I'll get:
r = a(-((40-b)2/(2c2))) ≈ 50..60
I plugged between 50 and 60 as my desired final top radius. Following that, I went futzed around with the coefficients a, b and c to obtain a curve that would meet the two end points nicely. Furthermore, at the end, I round the result to the nearest integer.
After some goofing around in Excel, I obtained this:
r = 0.1(-((Z-4)2/(2*202)))
Graphed, this gives me a beautiful, sharp curve. To increase its sharpness, increase b and decrease c.
This should be even better:
r = 0.1(-((Z-10.1)2/(2*162)))
Fantastic! At Z-level 40, rounded, I end up with a circle of gloooooorious radius 65. I surveyed the terrain and this'll mean my bell-mouth will finish right above my trade depot, giving the impression to incoming traders that the fortress IS the bell-mouth.
Let's plug this all back into my original circle formula:
x2 + y2 = (0.1(-((Z-4)2/(2*202))))2
With each Z-level, starting at 1, my rounded radius will be:
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
11
11
11
11
11
12
12
13
13
14
15
16
18
20
22
25
29
35
42
52
65
Easy peasy.
And now, I think I'm ready to build that thing!