Does rank corruption work if I have less cities than OCN?
I'm not entirely clear what you mean by 'work'. I think that the code to calculate rank corruption works in all cases that we know.
Justanick asks:
Why would it not? Rank corruption will dominate corruption in the long run even if your amount of cities is small.
Well if the empire has only one city, then it's rank R is 0, as Alexman's comment indicates. If R < Nopt, then we have "0 / (2 * Nopt)". But, that equals 0 in all cases. So, rank corruption for all those cases.
"Nopt = max(OCN * (L/100 * (1 + c + Gr + Gp*Nwe) + 0.25*Ni), 1)" implies that Nopt is at least 1. So, is R = Nopt or R > Nopt? Clearly we would have an abusrdity if either held true, since then 0 would have to be equal to 1 or greater than 1. So, neither "R = Nopt", nor "R > Nopt". In other worse, if a city's rank equals 0, then "otherwise" does not obtain in any case.
Consequently, Cr = 0 when an empire has one city. The rank corruption of the city is 0.
But, in such a case the rank corruption is exactly equal to the distance corruption. So, rank corruption wouldn't dominate corruption, because rank corruption ends up equal to corruption. Or to put things another way, all corruption is equal, when there is no corruption.
I don't know if Sakharov will ever do so, but playing with just one city is possible. Rank corruption won't dominate in the long run if you only have one city in your empire over the entire course of a game. And having one city is the quickest way to play a game until a decisive victory or loss.
I think it's fair to say that rank corruption does not work, in the sense of producing corruption, if one has less cities than the Opitmal City Number and only 1 city. However, the calculation for Cr likely always works. So, rank corruption works in the sense of 'Cr' as always getting calculated.