#include <bits/stdc++.h>
#define M 1000000007
#define endl '\n'
#define ll long long
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    ll t{0};
    cin>>t;
    while(t--){
    	ll n{0};
    	cin>>n;

    	ll arr[n+1];
    	for(ll i=1;i<=n;i++)
    		cin>>arr[i];

    	map<ll,ll> mp;
    	for(ll i=1;i<=n;i++)
    		mp[arr[i]-i]++;

    	ll ans{0};
    	for(auto it=mp.begin();it!=mp.end();it++){
    		ll temp=(it->second)*(it->second-1);
    		temp=temp/2;
    		ans+=temp;
    	}

    	cout<<ans<<endl;
    }

	return 0;
}
