#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(NULL),cin.tie(NULL),cout.tie(NULL)
#define ll long long
#define lli long long int
#define pb push_back
using namespace std;

int  main()
{       
   fast;  
   int t;
   cin>>t;
   while(t--){
       ll n;
       cin>>n;
       unordered_map<ll,ll>um;
       for(int i=0;i<n;i++){
           int x;
           cin>>x;
           um[x-i]++;
       }
       ll total=0;
       for(auto it:um){
           total+=(it.second)*(it.second-1)/2;
       }
       cout<<total<<endl;
   }  
   return 0;
}