#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(x,val) memset(x,val,sizeof(x))
#define F(i,n) for(ll i=0;i<n;i++)
#define pb push_back
#define endl '\n'
#define mod 1000000007
#define crap ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
int main(){
    crap;
    ll t;
    cin>>t;
    while(t--){
        ll n,ans=0;
        cin>>n;
        ll a[n];
        map<ll,ll> m;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
            a[i]=a[i]-i-1;
            m[a[i]]++;
        }
        for(auto x:m)
        {
        ll t=x.second;
        ans+=(t*(t-1))/2;
        }
        cout<<ans<<endl;

        }
return 0;
}