Notations:
C_k is the virtue cost of the k-th policy, before modifiers from cities and virtues
V_k is the multiplicative factor due to additional cities, for the k-th policy
q_k is the reduction for k_th policy, here q_k will be equal to 0.9 once the player takes the cohesive values virtue (after the 4th).
N_1 is the number of virtues invested taking Cohessive values, after T turns
N_2 is the number of virtues without that virtue after T turns (same time frame)
Note: Civ5 simply multiplies the base cost by an additive factor: V_k = (1 + p * (n_k - 1 ) ) where p is the penalty for additional cities and n the number of cities. By default p = 10% = 0.1.
Therefore the k-th policy always cost q_k*C_k * V_k if you have the virtue or C_k * V_k without (since q_k would always be equal to 1 here).
After a specific amount of time the total cost is:
With the virtue:
Sum(from 1 to N_1) q_k*C_k*V_k
Without the virtue:
Sum(from 1 to N_2) C_k*V_k
The "breaking point" would be the moment where N_1 = N_2 + 1 (so that you have "refunded" your investment) and the first sum to be smaller than the second but having 1 more policy.
What does this mean ?
This mean that the following argument:
the virtue cost increase for each extra city returns a factor which is used to multiply the virtue cost. So the number of cities would make no difference in a comparison.
is wrong because it assumes V_k are the same for all k, so that they do not intervene in the comparison. Or in other words it assumes that the increase in policy cost from the number of cities is retroactive. Which is not right. Or it assumes you have planted all your cities before taking the virtue, which is not right either.
However, does it mean Maddjinn is right ? Yes the number of cities intervene but how exactly, does it really make a big difference ?
The question would be: does it really change the OP conclusion.
I cannot provide an analytic response to it without a specific pattern for when cities are planted. But if you put these into Excell and then play around with varrying numbers of cities at different timings you will see the actual effect of cities.
The other question would be whether or not the 20 + (2n)^2 is the right formula. I used a general notation so my argumentation shouldn't be modified a lot if it is another formula, but values given by examples will have to be changed.
To provide an example, if I settle 1 city before virtue 5, 1 more before virtue 7, 1 more before 8 and 1 more before 9 I get the exact same breakpoints as OP (N_1 = 30). However if I settle later, say at virtue 7,10,12,14 then the breaking point is actually only one virtue later (N_1 = 31). More tests reveal that a breaking point at virtue 30 is the best scenario and at most you will change the breaking point by 1 virtue.
So to go back on what Maddjinn said. City number intervene yes. Is it better for 10 cities rather than OCC ? No, breakpoint is always in the 30-31 virtues area. If by that we assume the control would of course have produced as much culture and played the exact same of course.