I'm confused with writing recurrence equation for the algorithm below, could anyone help me do this?

Here is the algorithm:

```
ThreeSort(A{i..j]){
    n = j-i+1; // number of elements
    if (n==1) return;
    if (n==2) and (A[i] > A[j]) then swap A[i] with A[j]
    else if (n > 2) {
        third = round(n/3);
        ThreeSort(A[i..j-third]); // sort first 2/3rds
        ThreeSort(A[i+third..j]); // sort last 2/3rds
        ThreeSort(A[i..j-third]); // sort first 2/3rds
    }
}

```