description: British mathematician John Littlewood once said about Indian mathematician Srinivasa Ramanujan that "every positive integer was one of his personal friends."
  
  It turns out that positive integers can also be friends with each other! You are given an array a of distinct positive integers. 
  
  Define a subarray a_i, a_{i+1}, …, a_j to be a friend group if and only if there exists an integer m ≥ 2 such that a_i mod m = a_{i+1} mod m = … = a_j mod m, where x mod y denotes the remainder when x is divided by y.
  
  Your friend Gregor wants to know the size of the largest friend group in a.
  
  Input
  
  Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 2⋅ 10^4). 
  
  Each test case begins with a line containing the integer n (1 ≤ n ≤ 2 ⋅ 10^5), the size of the array a.
  
  The next line contains n positive integers a_1, a_2, …, a_n (1 ≤ a_i ≤ {10}^{18}), representing the contents of the array a. It is guaranteed that all the numbers in a are distinct.
  
  It is guaranteed that the sum of n over all test cases is less than 2⋅ 10^5.
  
  Output
  
  Your output should consist of t lines. Each line should consist of a single integer, the size of the largest friend group in a.
  
  Example
  
  Input
  
  
  4
  5
  1 5 2 4 6
  4
  8 2 5 10
  2
  1000 2000
  8
  465 55 3 54 234 12 45 78
  
  
  Output
  
  
  3
  3
  2
  6
  
  Note
  
  In the first test case, the array is [1,5,2,4,6]. The largest friend group is [2,4,6], since all those numbers are congruent to 0 modulo 2, so m=2.
  
  In the second test case, the array is [8,2,5,10]. The largest friend group is [8,2,5], since all those numbers are congruent to 2 modulo 3, so m=3.
  
  In the third case, the largest friend group is [1000,2000]. There are clearly many possible values of m that work.
solution: import java.io.*;
  import java.math.BigInteger;
  import java.util.*;
  import java.util.concurrent.TimeUnit;
  
  public class d1549 implements Runnable{
  	
      public static void main(String[] args) {
      	try{
              new Thread(null, new d1549(), "process", 1<<26).start();
          }
          catch(Exception e){
              System.out.println(e);
          }
      }
  	public void run() {
  		FastReader scan = new FastReader();
          PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
  		//PrintWriter out = new PrintWriter("file.out");
  		Task solver = new Task();
  		int t = scan.nextInt();
  		//int t = 1;
  		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
  		out.close();
  	}
  
  	static class Task {
  		static final int oo = Integer.MAX_VALUE;
  		static final long OO = Long.MAX_VALUE;
  
  		public void solve(int testNumber, FastReader sc, PrintWriter out) {
  			int N = sc.nextInt();
  			
  			long[] arr = sc.readLongArray(N);
  			
  			if(N == 1) {
  				out.println(1);
  				return;
  			}
  			
  			long[] diff = new long[N-1];
  			for(int i = 1; i < N; i++) {
  				diff[i-1] = Math.abs(arr[i] - arr[i-1]);
  			}
  
  			constructSegmentTree(diff);
  			
  			int max = 0;
  			for(int i = 0, j = 0; i < N-1; i++) {
  				
  				while(i != j && findRangeGcd(j, i, diff) < 2) {
  					j++;
  				}
  				
  				max = Math.max(max, i-j+2);
  			}
  			
  			boolean flag=  true;
  			for(long each: diff)
  				if(each != 1)
  					flag = false;
  			
  			if(flag) {
  				out.println(1);
  			} else 
  				out.println(max);
  		}
  		
  		private static long[] st;
  	    public static long[] constructSegmentTree(long[] arr)
  	    {
  	        int height = (int)Math.ceil(Math.log(arr.length)/Math.log(2));
  	        int size = 2*(int)Math.pow(2, height)-1;
  	        st = new long[size];
  	        constructST(arr, 0, arr.length-1, 0);
  	        return st;
  	    }
  	  
  	    public static long constructST(long[] arr, int ss,
  	                                  int se, int si)
  	    {
  	        if (ss==se)
  	        {
  	            st[si] = arr[ss];
  	            return st[si];
  	        }
  	        int mid = ss+(se-ss)/2;
  	        st[si] = gcd(constructST(arr, ss, mid, si*2+1),
  	                     constructST(arr, mid+1, se, si*2+2));
  	        return st[si];
  	    }
  	  
  	    private static long gcd(long a, long b)
  	    {
  	        if (a < b)
  	        {
  	            long temp = b;
  	            b = a;
  	            a = temp;
  	        }
  	  
  	        if (b==0)
  	            return a;
  	        return gcd(b,a%b);
  	    }
  	  
  	    public static long findRangeGcd(int ss, int se, long[] arr)
  	    {
  	        int n = arr.length;
  	  
  	        if (ss<0 || se > n-1 || ss>se)
  	            throw new IllegalArgumentException("Invalid arguments");
  	  
  	        return findGcd(0, n-1, ss, se, 0);
  	    }
  	  
  	    public static long findGcd(int ss, int se, int qs, int qe, int si)
  	    {
  	        if (ss>qe || se < qs)
  	            return 0;
  	  
  	        if (qs<=ss && qe>=se)
  	            return st[si];
  	  
  	        int mid = ss+(se-ss)/2;
  	  
  	        return gcd(findGcd(ss, mid, qs, qe, si*2+1),
  	                   findGcd(mid+1, se, qs, qe, si*2+2));
  	    }
  		
  	}
  	static long modInverse(long N, long MOD) {
  		return binpow(N, MOD - 2, MOD);
  	}
  	static long modDivide(long a, long b, long MOD) {
  		a %= MOD;
  		return (binpow(b, MOD-2, MOD) * a) % MOD;
  	}
  	static long binpow(long a, long b, long m) {
  		a %= m;
  		long res = 1;
  		while (b > 0) {
  			if ((b & 1) == 1)
  				res = res * a % m;
  			a = a * a % m;
  			b >>= 1;
  		}
  		return res;
  	}
  	static int[] reverse(int a[]) 
      { 
          int[] b = new int[a.length]; 
          for (int i = 0, j = a.length; i < a.length; i++, j--) { 
              b[j - 1] = a[i]; 
          } 
          
          return b;
      }
  	static long[] reverse(long a[]) 
      { 
          long[] b = new long[a.length]; 
          for (int i = 0, j = a.length; i < a.length; i++, j--) { 
              b[j - 1] = a[i]; 
          } 
          
          return b;
      }
  	
  	static void shuffle(Object[] a) {
  		Random get = new Random();
  		for (int i = 0; i < a.length; i++) {
  			int r = get.nextInt(a.length);
  			Object temp = a[i];
  			a[i] = a[r];
  			a[r] = temp;
  		}
  	}
  	
  	static void shuffle(int[] a) {
  		Random get = new Random();
  		for (int i = 0; i < a.length; i++) {
  			int r = get.nextInt(a.length);
  			int temp = a[i];
  			a[i] = a[r];
  			a[r] = temp;
  		}
  	}
  	static void shuffle(long[] a) {
  		Random get = new Random();
  		for (int i = 0; i < a.length; i++) {
  			int r = get.nextInt(a.length);
  			long temp = a[i];
  			a[i] = a[r];
  			a[r] = temp;
  		}
  	}
  	
  	static class tup implements Comparable<tup>, Comparator<tup>{
  		int a, b;
  		tup(int a,int b){
  			this.a=a;
  			this.b=b;
  		}
  		public tup() {
  		}
  		@Override
  		public int compareTo(tup o){
  			return Integer.compare(b,o.b);
  		}
  		@Override
  		public int compare(tup o1, tup o2) {
  			return Integer.compare(o1.b, o2.b);
  		}
  		
  		@Override
  	    public int hashCode() {
  			return Objects.hash(a, b);
  	    }
   
  	    @Override
  	    public boolean equals(Object obj) {
  	    	if (this == obj)
                  return true;
  	    	if (obj == null)
                  return false;
  	    	if (getClass() != obj.getClass())
                  return false;
  	    	tup other = (tup) obj;
  	    	return a==other.a && b==other.b;
  	    }
  	    
  	    @Override
  	    public String toString() {
  	    	return a + " " + b;
  	    }
  	}
  
  	static class FastReader {
  		BufferedReader br;
  		StringTokenizer st;
  
  		public FastReader() {
  			br = new BufferedReader(new InputStreamReader(System.in));
  		}
  
  		public FastReader(String s) throws FileNotFoundException {
  			br = new BufferedReader(new FileReader(new File(s)));
  		}
  
  		String next() {
  			while (st == null || !st.hasMoreElements()) {
  				try {
  					st = new StringTokenizer(br.readLine());
  				} catch (IOException e) {
  					e.printStackTrace();
  				}
  			}
  			return st.nextToken();
  		}
  
  		int nextInt() {
  			return Integer.parseInt(next());
  		}
  
  		long nextLong() {
  			return Long.parseLong(next());
  		}
  
  		double nextDouble() {
  			return Double.parseDouble(next());
  		}
  
  		String nextLine() {
  			String str = "";
  			try {
  				str = br.readLine();
  			} catch (IOException e) {
  				e.printStackTrace();
  			}
  			return str;
  		}
  		
  		int[] readArray(int size) {
  			int[] a = new int[size];
  			for(int i = 0; i < size; i++) {
  				a[i] = nextInt();
  			}
  			return a;
  		}
  		
  		long[] readLongArray(int size) {
  			long[] a = new long[size];
  			for(int i = 0; i < size; i++) {
  				a[i] = nextLong();
  			}
  			return a;
  		}
  	}
  	
  	static void dbg(int[] arr) {
  		System.out.println(Arrays.toString(arr));
  	}
  	static void dbg(long[] arr) {
  		System.out.println(Arrays.toString(arr));
  	}
  	static void dbg(boolean[] arr) {
  		System.out.println(Arrays.toString(arr));
  	}
  
  	static void dbg(Object... args) {
          for (Object arg : args)
              System.out.print(arg + " ");
          System.out.println();
      }
  }