#include <bits/stdc++.h>
#define ll long long int
using namespace std;



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