#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);    cin.tie(NULL);   cout.tie(NULL);


int main() {
    fast
	ll t;
	cin>>t;
	while(t--)
    {
        ll n,num;
        long double temp;
        ll ans=0;
        cin>>n;
        map<ll,ll>m;
        for(ll i=0;i<n;i++)
        {
            cin>>num;
            m[num-i]++;
        }
        for(auto v:m)
        {
            if(v.second>1);
            {
                temp=((v.second-1)*(v.second))/2;
                ans+=temp;
            }
        }
        cout<<ans<<endl;
    }
	return 0;
}


