#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector < pii > vpii;
typedef vector < pll > vpll;
typedef vector <string> vs;
typedef vector < vi > vvi;
typedef vector < vll > vvll;
typedef vector< vpii > vvpii;
typedef vector< vpll > vvpll;
#define all(v)     (v).begin(), (v).end()
#define srt(v)    sort (all (v))
#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x).size())
#define rv(a,n) for(int i=0;i<n;i++)cin>>a[i]
const ll mod=1000000007;

int main(){
        int t;
        cin>>t;
          while(t--){
          int n;
          cin>>n;
          vll a(n);
          rv(a,n);
          for(int i=0;i<n;i++){
            a[i]-=i;
          }
          map<ll,ll>M;
          for(auto x:a){
            M[x]++;
          }
          ll ans=0;
          for(auto x:M){
          ll val=x.second;
          ans+=((val*(val-1))/2);
          }
          cout<<ans<<endl;

        }

        
        
    return 0;
}