%I #18 Jan 07 2016 02:57:06
%S 1,2,0,1,0,2,0,0,3,1,0,4,0,0,1,0,1,2,0,0,0,2,0,1,0,0,1,1,0,0,1,2,0,0,
%T 3,0,1,0,1,2,3,1,0,0,0,4,0,0,1,0,1,0,3,4,1,0,7,2,0,0,1,0,0,2,0,1,0,1,
%U 0,0,1,1,0,0,0,2,0,0,1,6,0,0,5,0,1,0,3,2,3,0,1,0,1,4,3,1,0,0,0,0,0,10,0
%N Table read by rows: for each k < n and coprime to n, the least x>=0 such that x*n+k is prime.
%C By Dirichlet's theorem, such x exists whenever k is coprime to n.
%C By Linnik's theorem, there exist constants b and c such that T(n,k) <= b n^c for all n and all k < n coprime to n.
%C T(n,1) = A034693(n).
%C T(n,n-1) = A053989(n)-1.
%C T(prime(n),1) = A035096(n).
%C T(2^n,1) = A035050(n).
%C A085427(n) = T(2^n,2^n-1) + 1.
%C A126717(n) = 2*T(2^(n+1),2^n-1) + 1.
%C A257378(n) = 2*T(n*2^(n+1),n*2^n+1) + 1.
%C A257379(n) = 2*T(n*2^(n+1),n*2^n-1) + 1.
%H Robert Israel, <a href="/A266909/b266909.txt">Table of n, a(n) for n = 1..10975</a> (rows 2 to 190, flattened)
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Dirichlet%27s_theorem_on_arithmetic_progressions">Dirichlet's theorem on arithmetic progressions</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Linnik%27s_theorem">Linnik's theorem</a>
%H <a href="/index/Pri#primes_AP">Index entries for sequences related to primes in arithmetic progressions</a>
%e The first few rows are
%e n=2: 1
%e n=3: 2, 0
%e n=4: 1, 0
%e n=5: 2, 0, 0, 3
%e n=6: 1, 0
%p T:= proc(n,k) local x;
%p if igcd(n,k) <> 1 then return NULL fi;
%p for x from 0 do if isprime(x*n+k) then return x fi
%p od
%p end proc:
%p seq(seq(T(n,k),k=1..n-1),n=2..30);
%t Table[Map[Catch@ Do[x = 0; While[! PrimeQ[x n + #], x++]; Throw@ x, {10^3}] &, Range@ n /. k_ /; GCD[k, n] > 1 -> Nothing], {n, 2, 19}] // Flatten (* _Michael De Vlieger_, Jan 06 2016 *)
%Y Cf. A034693, A035050, A035096, A053989, A085427, A126717, A257378, A257379.
%K nonn,tabf
%O 1,2
%A _Robert Israel_, Jan 05 2016
|