login
Square array T(n,k) = min{j>=0 | f(j+1) is prime}, where f(0)=prime(n), f(1)=k, f(j+1)=f(j)+f(j-1); or 0 if there is no such j>=0. Read by antidiagonals, n>=1, k>=0.
0

%I #22 Jul 16 2015 21:48:19

%S 1,1,1,0,2,1,0,0,2,1,0,0,0,3,1,0,1,0,0,2,1,0,0,2,0,0,3,1,0,0,0,1,0,0,

%T 2,1,0,0,1,0,2,0,0,3,1,1,1,0,1,0,1,0,0,6,1,0,0,1,0,1,0,4,0,0,2,1,0,1,

%U 2,2,0,1,0,1,0,0,5,1,0,0,0,3,1,0,1,0,2,0,0,5,1,0,0,0,1,2,2,0,2,0,2,0,0,2,1,0,0,1,0,2,2,5,0,1,0,4,0,0,3,1,1,1,0,1,0,1,3,4,0,2,0,1

%N Square array T(n,k) = min{j>=0 | f(j+1) is prime}, where f(0)=prime(n), f(1)=k, f(j+1)=f(j)+f(j-1); or 0 if there is no such j>=0. Read by antidiagonals, n>=1, k>=0.

%C Consider the Fibonacci sequence f(j+1)=f(j)+f(j-1) starting with f(0)=prime(n) and some f(1)=k>=0. Count how many nonprimes follow after the initial prime f(0), before the next prime term. Obviously, if f(1) is a positive multiple of f(0), then all following terms are positive multiples of f(0) and therefore composite; in this case we set T(n,k)=0.

%C This is somehow complementary to the search of primes in arithmetic progression, where one looks for the length of chains of prime terms.

%e The square array is:

%e n ( p) k=0 1 2 3 4 5 6 7

%e 1 ( 2) : 1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,...

%e 2 ( 3) : 1,2,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,...

%e 3 ( 5) : 1,2,0,0,2,0,1,0,1,2,0,0,1,0,1,0,2,0,1,0,0,...

%e 4 ( 7) : 1,3,0,0,1,0,1,0,2,3,1,0,1,0,0,2,1,0,2,0,2,...

%e 5 (11) : 1,2,0,0,2,0,1,0,1,2,2,0,1,0,4,2,2,0,1,0,1,... etc.

%e The entry of the array is the least index >= 0 after which a prime is reached, in the Fibonacci sequence f(0)=p=prime(n), f(1)=k, f(j+1)=f(j)+f(j-1).

%e For n=4 (f(0)=prime(4)=7), k=0 yields f=(7,0,7,7,14,....): T(n,k)=1 nonprime (0), f(1+1)=7 is prime.

%e k=1 yields f=(7,1,8,9,17,....): T(n,k)=3 nonprimes (1,8,9), f(3+1)=17 is prime.

%e k=2 yields f=(7,2,9,11,....): T(n,k)=0 nonprimes, since f(0+1)=2 is already prime.

%o (PARI) T(n,k)=if(k%n=prime(n),!isprime(k) & for(c=1,1e9,ispseudoprime(k=n+0+n=k)&return(c)),!k)

%o for(n=1,19,for(k=0,n-1,print1(T(k+1,n-k-1)","))) /* to list antidiagonals starting at (1,k=n-1) and ending at (n,k=0) */

%K nonn,tabl

%O 0,5

%A _M. F. Hasler_, Dec 13 2010