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

#define F(x,n) for(int j=x;j<n;j++)
#define f(x,n) for(int i=x;i<n;i++)
#define ll long long
#define pb push_back
#define pf push_front
#define ff first
#define ss second

const int M=1e9+7;
const int INF=2e6;

void solve(){
    int n,x;
    cin>>n;
    map<int,int> s;
    ll ans=0;
    f(0,n){
        cin>>x;
        ans+=s[x-i];
        s[x-i]++;
    }
    cout<<ans<<endl;
}

int main(){
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    int t;
    cin>>t;
    while(t--)
    solve();
}