#include<bits/stdc++.h>
using namespace std;

int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int a;
		map<int, int> order;
		cin>>a;
		order[a-0]++;
		long long int count=0;
		for(int i=1;i<n;i++){
			cin>>a;
            order[a-i]++;
		}
	for (auto i = order.begin(); i!= order.end(); i++) {
                  if(i->second>1){
                  	    long long int k =i->second;
                  	    k=k-1;
                  	    count =count+ (k*(k+1))/2;
//                      max = i->first;
//                      freq = i->second;
                  }
           }
           cout<<count<<"\n";
	}
}
