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.DataInputStream;
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.util.AbstractMap;
  import java.util.Comparator;
  import java.util.HashMap;
  import java.util.Map;
  import java.util.Map.Entry;
  import java.util.PriorityQueue;
  import java.util.*;
  import java.io.*;
  
  // Java Template Pramod Hosahalli...
  @SuppressWarnings("unused")
  public class Solution {
  
  	static FastReader in = new FastReader();
  	//static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
  	static int mod = 1000000007;
  
  	private static void go() throws Exception{
  		int n = in.ni();
  		long[] a = new long[n];
  
  		for(int i = 0; i < n; i++){
  			a[i] = in.nl();
  		}
  
  		if(n == 1){
  			print(1, "1");
  			return;
  		}
  		long[] b = new long[n-1];
  		for(int i = 0; i < b.length; i++) b[i] = Math.abs(a[i] - a[i+1]);
  		long[][] f = SparseTable.precompute(b);
  
  		int maxima = 1;
  		for(int j = 0; j < b.length; j++){
  			if(f[0][j] == 1) continue;
  			long g = -1;
  			int curr = j;
  			for(int p = f.length-1; p >= 0; p--){
  				if(curr == b.length)break;
  				if(f[p][curr] > 1 && (g == -1 || gcd(g, f[p][curr]) > 1)){
  					if(g == -1) g = f[p][curr];
  					else g = gcd(g, f[p][curr]);
  					curr = curr + (1 << p);
  				}
  			}
  			maxima = Math.max(maxima, curr - j + 1);
  		}
  		print(1, maxima + "");
      }
  
  	public static void main(String[] args) throws Exception {
  		int t = in.ni();
          //int t = pi(in.readLine());
  		for(int _i = 1; _i <= t; _i++){
  			go();
  		}
  		in.close();
  	}
  
  	static long mul(long a, long b) {
  		return ((a % mod) * (b % mod)) % mod;
  	}
  
  	static class FastReader {
  		final private int BUFFER_SIZE = 1 << 16;
  		private DataInputStream din;
  		private byte[] buffer;
  		private int bufferPointer, bytesRead;
  
  		public FastReader() {
  			din = new DataInputStream(System.in);
  			buffer = new byte[BUFFER_SIZE];
  			bufferPointer = bytesRead = 0;
  		}
  
  		public FastReader(String file_name) throws IOException {
  			din = new DataInputStream(new FileInputStream(file_name));
  			buffer = new byte[BUFFER_SIZE];
  			bufferPointer = bytesRead = 0;
  		}
  
  		public String readLine() throws IOException {
  			byte[] buf = new byte[64]; // line length
  			int cnt = 0, c;
  			while ((c = read()) != -1) {
  				if (c == '\n') {
  					if (cnt != 0) {
  						break;
  					} else {
  						continue;
  					}
  				}
  				buf[cnt++] = (byte) c;
  			}
  			return new String(buf, 0, cnt);
  		}
  
  		public int ni() throws IOException {
  			int ret = 0;
  			byte c = read();
  			while (c <= ' ') {
  				c = read();
  			}
  			boolean neg = (c == '-');
  			if (neg)
  				c = read();
  			do {
  				ret = ret * 10 + c - '0';
  			} while ((c = read()) >= '0' && c <= '9');
  
  			if (neg)
  				return -ret;
  			return ret;
  		}
  
  		public long nl() throws IOException {
  			long ret = 0;
  			byte c = read();
  			while (c <= ' ')
  				c = read();
  			boolean neg = (c == '-');
  			if (neg)
  				c = read();
  			do {
  				ret = ret * 10 + c - '0';
  			} while ((c = read()) >= '0' && c <= '9');
  			if (neg)
  				return -ret;
  			return ret;
  		}
  
  		public double nd() throws IOException {
  			double ret = 0, div = 1;
  			byte c = read();
  			while (c <= ' ')
  				c = read();
  			boolean neg = (c == '-');
  			if (neg)
  				c = read();
  
  			do {
  				ret = ret * 10 + c - '0';
  			} while ((c = read()) >= '0' && c <= '9');
  
  			if (c == '.') {
  				while ((c = read()) >= '0' && c <= '9') {
  					ret += (c - '0') / (div *= 10);
  				}
  			}
  
  			if (neg)
  				return -ret;
  			return ret;
  		}
  
  		private void fillBuffer() throws IOException {
  			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
  			if (bytesRead == -1)
  				buffer[0] = -1;
  		}
  
  		private byte read() throws IOException {
  			if (bufferPointer == bytesRead)
  				fillBuffer();
  			return buffer[bufferPointer++];
  		}
  
  		public void close() throws IOException {
  			if (din == null)
  				return;
  			din.close();
  		}
  	}
  
  	static String rl() throws Exception{
  		return in.readLine();
  	}
  
  	static int pi(String s) {
  		return Integer.parseInt(s);
  	}
  
  	static long pl(String s) {
  		return Long.parseLong(s);
  	}
  
  	static void print(int newline, String s) {
  		System.out.print(s);
  		if (newline != 0)
  			System.out.println();
  		// System.out.flush();
  	}
  
  	static void cprint(int x) {
  		print(0, "Case #" + x + ": ");
  	}
  
  	//utility function for gcd
  	private static long gcd(long a, long b)
  	{
  		if(a == 0 || b == 0)return a + b;
  		if(a > b)return gcd(a % b, b);
  		return gcd(a, b % a);
  	}
  
  	// construct sparse table : for static range queries
  	static class SparseTable{
  
  		static long[][] precompute(long[] arr)
  		{
  			int n = arr.length;
  			int p = (int)((double)Math.log(n) / Math.log(2));
  			long[][] f = new long[p+1][n];
  
  			for(int i = 0; i < n; i++) f[0][i] = arr[i];
  			for(int j = 1; j <= p; j++){
  				for(int i = 0; i + (1 << j) - 1 < n; i++){
  					f[j][i] = gcd(f[j-1][i], f[j-1][i + (1 << (j-1))]);
  				}
  			}
  			return f;
  		}
  
  	}
  
  }