Good old fashioned geometry! What use Excel now?
Let's have a go anyway...
Say the square is centred on the origin and aligned with the axes, so its vertices are (+- s, +- s). Then the biggest pipe A is centred on O and has radius s.
Let the top-right middle-sized pipe B have centre P. Since we know radius(

= 4, and B is tight into the corner, we have P = (s-4, s-4).
Let K be the point of contact between pipes A and B, X be the point of contact between B and the right wall. Clearly X = (s, s-4). It is also obvious that angle KPX = 135 degrees. This along with the facts that PK = PX = 4 and sin 45deg = cos 45def = sqrt(2)/2 gives us K = (s-4-2sqrt(2), s-4-2sqrt(2))
But since A is a circle it has constant radius, so OK = s, so by Pythagoras 2(s-4-2sqrt(2))^2 = s^2. Let d = 4+2sqrt(2), then
2(s-d)^2 = s^2 s^2 -4ds + 2d^2 = 0 (s-2d)^2 = 2d^2 s-2d = sqrt(2)d s = (2+sqrt(2))d = (2+sqrt(2))(4+sqrt(2)) = 10 + 6sqrt(2) (~= 18.5)
This will surely prove useful soon. Also, K = (6+4sqrt(2), 6+4sqrt(2)).
Now let the smallest pipe C be centred on Q and have radius r. We have three constraints on Q:
1: OQ = s+r 2: PQ = 4+r 3: x coordinate of Q = s-r
Let Q = (x,y). Then these constraints become
1': x^2 + y^2 = (s+r)^2 2': (x-s+4)^2 + (y-s+4)^2 = (4+r)^2 3': x = s-r
Substitute 3' into 1' giving
(s-r)^2 + y^2 = (s+r)^2 s^2 - 2rs + r^2 + y^2 = s^2 + 2rs + r^2 4': y^2 = 4rs
Substitute 3' into 2' giving
(s-r-s+4)^2 + (y-s+4)^2 = (4+r)^2 (-r+4)^2 + (y-s+4)^2 = (4+r)^2 (y-s+4)^2 = (4+r)^2 - (4-r)^2 = 16r = 4y^2 / s (by 4'

y^2 - 2ys + 8y + s^2 - 8s + 16 = 4y^2 / s (s-4)y^2 - 2ys^2 + 8ys + s^3 - 8s^2 + 16s = 0
Write q for sqrt(2) and expand out all these s expressions (s = 10+6q, s^2 = 172+120q, s^3 = 3160+2232q)
y^2(s-4) + y(-2s^2 + 8s) + (s^3 - 8s^2 + 16s) = 0 y^2(6+6q) + y(-344-240q+80+48q) + (3160+2232q-1376-960q+160+96q) = 0 y^2(6+6q) + y(-264-192q) + (1944+1368q) = 0 y^2(1+q) + y(-44-32q) + (324+228q) = 0
Discriminant D ('b^2-4ac'

= 3984+2816q - 4.(1+q).(324+228q) = 3984 + 2816q - 4(780+552q) = 864 + 608q
D = 16(54+38q)
Solutions for y are therefore
(44+32q +- 4sqrt(54+38q)) / 2(1+q)
which are both positive but taking the + gives ~ 27 which is > s and hence too large. So we have
y = (44+32q-4sqrt(54+38q))/2(1+q)
y^2 = (1936 + 2816q - 352sqrt(54+38q) + 2048 - 256q.sqrt(54+38q) + 16(54+38q)) / 4(1+q)^2
By 4' we thus have
r = (4848 + 3424q - (352+256q)sqrt(54+38q)) / 4s.4(1+q)^2 = (4848 + 3424q - (352+256q)sqrt(54+38q)) / 16(10+6q)(1+q)^2 = 16 ( 303 + 214q - (22+16q)sqrt(54+38q) ) / 16 ( 54 + 38q ) = ( 303 + 214q - (22+16q)sqrt(54+38q)) / (54 + 38q)
~= 1.321
This satisfies 1' 2' and 3', and also looks in the right ballpark for a smallest pipe. Given the spectacularly ugly closed form I can't believe there's an 'elegant' solution waiting in the wings...