RMS of an inverted sine wave
We know that the RMS of a signal is calculated with the following:
$$
\mathrm{
x_{rms}=\sqrt{\frac{1}{T}\int_0^T x^2(t)dt}
}
$$
Since the integral is the sum of infinitesimal values, it turns into a Sigma function for discrete signals:
$$
\mathrm{
x_{rms}=\sqrt{\frac{1}{N}\sum_{i=0}^N x_i^2}
}
$$
Here's a pseudo-code for you:
sum = 0;
for (each adc_value in samples_for_one_period)
{
    x = adc_value - adc_val_2v5;
    y = x * x;
    sum = sum + y;
}

rms = sqrt (sum / num_samples);

NOTE: Even though the result does not change when used with an inverting amplifier, I'd use a non-inverting amplifier:



simulate this circuit &ndash; Schematic created using CircuitLab
$$
\mathrm{
A_v=1+\frac{RG1}{RG2}
\\ \\ V_o = 2.5V + A_v\cdot V_i
}
$$