%I #9 Oct 28 2021 06:27:57
%S 3,3,2,1,1,1,3,5,2,2,3,2,3,1,1,1,1,1,4,2,2,3,5,2,2,2,1,2,2,4,1,1,3
%N Table T(n, k) read by antidiagonals: maximal length of arithmetic progression of primes starting at prime(n) and with common difference 2*k.
%H M. Goetz, <a href="http://www.primegrid.com/forum_thread.php?id=7022&nowrap=true#98979">Welcome to the AP27 Search</a>.
%e T(5, 3) = 4, because prime(5) = 11 and 11+2*3 = 17, 17+2*3 = 23, 23+2*3 = 29 are all prime, but 29+2*3 = 35 is composite, so 4 terms in the arithmetic progression of primes with common difference 6 starting at 11 are prime.
%e Table starts
%e 3, 3, 1, 3, 3, 1, 3, 2
%e 2, 1, 5, 2, 1, 5, 2, 1
%e 1, 2, 3, 1, 2, 4, 1, 2
%e 2, 1, 4, 2, 1, 2, 1, 1
%e 1, 2, 2, 1, 2, 1, 1, 2
%e 2, 1, 3, 1, 1, 4, 2, 1
%o (PARI) max_prog_len(initialp, diff) = my(i=1, p=initialp); while(ispseudoprime(p+diff), p=p+diff; i++); i
%o table(rows, cols) = for(n=2, rows+1, for(k=1, cols, print1(max_prog_len(prime(n), 2*k), ", ")); print(""))
%o table(6, 8) \\ print 6x8 table
%K nonn,tabl,more
%O 2,1
%A _Felix Fröhlich_, Nov 26 2016
|