login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Irregular triangle read by rows in which row n lists the positive values k such that there are k-1 primes in the open interval (n-k,n+k).
0

%I #31 Apr 25 2013 17:51:59

%S 1,2,3,3,4,4,5,1,5,2,5,1,3,4,5,6,2,3,5,6,7,1,2,4,6,7,1,3,5,1,2,4,2,3,

%T 1,3,2,3,1,2,4,1,3,5,1,2,4,2,3,1,3,2,3,1,2,4,1,3,1,2,2,1,2,1,1,1,1,2,

%U 2,3,1,3,2,3,1,2,1,1,1,1,2,2,1,2,1,3,1,2,4,2,3,1,3,2,3,1,2,4

%N Irregular triangle read by rows in which row n lists the positive values k such that there are k-1 primes in the open interval (n-k,n+k).

%C If either n - k or n + k are prime, they are not counted.

%C Rows n containing 1: 1, 4, 6, 8, 9, 10, 12, 14, 15, 16, ...(A018252).

%C Rows n containing 2: 1, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20,...

%C Rows n containing 3: 1, 2, 6, 7, 9, 11, 12, 13, 15, 17, 18, 19,...

%C Rows n containing 4: 2, 3, 6, 8, 10, 14, 16, 20, 40, 44, 70, 100,...

%C Rows n containing 5: 3, 4, 5, 6, 7, 9, 15, 105, 195,...

%C Rows n containing 6: 6, 7, 8.

%C Rows n containing 7: 7, 8.

%C All values of k are less than 8.

%C Row lengths are: 3, 2, 2, 2, 2, 5, 5, 5, 3, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 3, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 3,...

%C Smallest positive k such that there are k-1 primes between n - k and n + k: 1, 1, 3, 4, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1,...

%C Sequence of final entry in row n: 3, 4, 5, 5, 5, 6, 7, 7, 5, 4, 3, 3, 3, 4, 5, 4, 3, 3, 3, 4, 3, 2, 2,..

%C Row sums are: 6, 7, 9, 6, 7, 19, 23, 20, 9, 7, 5, 4, 5, 7, 9, 7, 5,...

%C Largest nonnegative k such that there are k primes in the interval (n-k,n+k): 0, 2, 3, 4, 4, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0,...

%C Numbers n such that there are two primes in (n-2,n+2): 2, 3, 4, 6, 12, .. continuing as in A014574.

%C Irregular triangle read by rows in which row n lists the nonnegative values k such that there are k primes in (n-2*k,n+2*k): 0,1,2,3,4 ; 4,5,6; 4,5,6; 0,6,7,8; 1,6,7,8; 0,8,9; 1,2,8,9; 0,1,9; 0,2,9;...

%e Triangle begins:

%e 1, 2, 3;

%e 3, 4;

%e 4, 5;

%e 1, 5;

%e 2, 5;

%e 1, 3, 4, 5, 6;

%e 2, 3, 5, 6, 7;

%e 1, 2, 4, 6, 7;

%e 1, 3, 5;

%e 1, 2, 4;

%e 2, 3;

%e 1, 3;

%e 2, 3;

%e 1, 2, 4;

%e 1, 3, 5.

%e First row:

%e n = 1, k = 1, no primes between 0 and 2.

%e n = 1, k = 2, one prime between -1 and 3.

%e n = 1, k = 3, two primes between -2 and 4.

%e Fifth row:

%e n = 4, k = 1, 0 primes between 3 and 5.

%e n = 4, k = 5, 4 primes between -1 and 9 (2, 3, 5, and 7).

%p for n from 1 to 45 do

%p for k from 1 to 4*n do

%p numtheory[pi](n+k-1)-numtheory[pi](n-k) ;

%p if % = k-1 then

%p printf("%d,",k) ;

%p end if;

%p end do:

%p printf("\n") ;

%p end do: # _R. J. Mathar_, Apr 25 2013

%K nonn,tabf,less

%O 1,2

%A _Juri-Stepan Gerasimov_, Mar 16 2013