Effective sample size calculations are based on:
Liu, G., and Liang, K. Y. (1997). Sample size calculations for studies with correlated observations. Biometrics, 53(3), 937-47."full" method: if V_x = var(Y;x) is the variance-covariance matrix of Y, the response, based on the covariate x, then the effective sample size corresponding to this covariate is \Sigma_{i,j} (V_x^{-1})_{i,j}. In R notation, this is: sum(solve(V_x)).
"approximate" method: Letting m be the mean number of samples per group, k be the number of groups, and rho be the intraclass correlation, the effective sample size is m*k / (1+rho*(m-1))
Note that these values are equal when there are exactly m samples in each group. If m is only an average then this an approximation.