#include <bits/stdc++.h>
#define MP make_pair
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); ++ i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++ i)
#define foreach(itr, c) for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); ++ itr)

typedef long long LL;
typedef pair<int, int> pii;

const int N = 2e5 + 5;

int n, a[N];
map<int, int> mp;

void solve()
{   
    mp.clear();
    scanf("%d", &n);
    rep(i, n) scanf("%d", &a[i]), mp[a[i] - i] ++;
    LL ret = 0;
    for (auto i : mp){
        LL cnt = i.second;
        ret += (cnt - 1) * cnt / 2;
    }
    printf("%lld\n", ret);
}

int main()
{
    int T; scanf("%d", &T);
    while (T --) solve();
    return 0;
}