#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("Ofast")
//*********************************************0123456789****************************************************************
#include<bits/stdc++.h> 
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define mod 1000000007
#define pi 3.14159265359
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "YES"<<endl
#define no  cout<< "NO"<<endl
#define all(v) (v).begin(),(v).end()
#define s(v)   sort(v,v+n)
#define r(v) reverse(v,v+n)
#define read(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define print(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" "
#define for1(i,a,n)  for(int i=0;i<n;i++)
#define rep(i, c) for(int i = 0; i < (int)c; i++)
#define set(x) cout<<setprecision(x)<<fixed;
# define sz(x) (int)((x).size())
#define cone(x) (__builtin_popcountll(x))        // zero indexed
#define fone(x) (__builtin_ffsll(x) -1LL)        //give wrong answer if x==0;(zero indexed)
#define mone(x) (63LL-__builtin_clzll(x)) 
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define RUN ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(output) cout<<#output<<"="<<output<<endl
using namespace std;
std::vector<int>adj[10000];
bool visited[10000];
vector<int>v;
string str;
signed main()
{   
    RUN;
    int test=1,z=1;
    cin>>test;
    while(test--)
    { 
       int n;
       cin>>n;
       int a[n];
       read(a,n);
       map<int,int>m;
       for(int i=0;i<n;i++)
       {
           m[a[i]-i]++;
       }
       int aa=0;
       for(auto xx:m)
       {
           int x=xx.ss;
           aa+=(x*(x-1))/2;
       }
       cout<<aa<<"\n";
    }
}