Use the geometric mean for the average interest rate in a time series.
gm = (1.02*1.03*1.02*1.02*1.035*1.03)^(1/6) - 1 = 0.02581541058
Comparing the interest over six years.
1.02*1.03*1.02*1.02*1.035*1.03 - 1 = 16.5239812 %
(1 + gm)^6 - 1 = 16.5239812 %
The equivalent annual annuity calculation (shown in the derivation) becomes
pv = (c 1.02^5 + c 1.03^4 + c 1.02^3 +
c 1.02^2 + c 1.035^1 + c 1.03^0)/(1 + gm)^6
∴ c = (pv (1 + gm)^6)/
(1.02^5 + 1.03^4 + 1.02^3 + 1.02^2 + 1.035 + 1)
pv = $15000
∴ c = $2745.53
where c
is the annuity cash flow.
For a monthly calculation the monthly rate is (1 + r)^(1/12) - 1
where r
is the annual effective rate or the nominal annual rate compounded annually.
(The equivalent annual annuity calculation should use the annual effective rate or the nominal annual rate compounded annual, which is the same. However, if you are calculating an equivalent monthly annuity the monthly rate can be taken as the nominal annual rate 'compounded monthly' divided by twelve.)
Derivation & Check
The equivalent annuity is based on the following summation, which shows the present value pv
equal to the future value of the sum of the periodic cash flows (made at the beginning of each period) discounted to present value by division by (1 + r)^n
.

By induction, the closed form is pv = (c - c (1 + r)^-n)/r
∴ c = (r pv)/(1 - (1 + r)^-n)
which matches the formula provided by the OP.
Adding in webpage example figures.
pv = 100000
n = 4
r = 0.08
∴ c = (r pv)/(1 - (1 + r)^-n) = 30192.08
Expressed as summation with geometric mean.
gm = (1.08*1.08*1.08*1.08)^(1/4) - 1 = 0.08
pv = (c 1.08^3 + c 1.08^2 + c 1.08^1 + c 1.08^0)/(1 + gm)^4 = 100000
So the summation expression checks out, although the example is a simplified case with a constant interest rate.