#include <bits/stdc++.h>

#define flin            freopen("input.txt", "r", stdin); 
#define flout           freopen("output.txt", "w", stdout);
#define ll              long long
#define ull             unsigned long long
#define fastio          ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define nl              '\n'
#define nll             '\0'
#define pb              push_back
#define bdyptb          return 0;
#define sorted(x)       sort(x.begin(), x.end())
#define reversed(x)     reverse(x.begin(), x.end())
#define all(x)          x.begin(), x.end()
#define mset(a, b)      memset(a, b, sizeof(a));
#define testcase        ll t,tt; cin>>tt; for(t=1;t<=tt;t++)

#define pi acos(-1.00)   
#define mx 1000007

using namespace std;

int main()
{
    fastio;
    testcase
    {
        int n;
        cin>>n;
        int  a;
        map<int, int> mp;
        for(int i=0; i<n; i++)
        {
            cin>>a;
            mp[a - i] ++;
        }
        map<int, int>::iterator it;
        ll ans =0;
        for(it=mp.begin(); it!=mp.end(); it++)
        {
            ll x=it->second;
            ans+= x*(x-1)/2;
        }
        cout<<ans<<nl;
    } 
}