login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Irregular triangle read by rows: T(n,k) = number of times a gap of k occurs between the first n successive primes.
2

%I #14 Nov 17 2016 05:19:25

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

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

%U 6,0,5,0,4,1,7,0,5,0,4,1,7,0,5,0,5,1,7,0,6,0,5,1,8,0,6,0,5,1,8,0,6,0,6,1,8,0,7,0,6,1,8,0,7,0,7,1,8,0,7,0,7,0,1,1,8,0,8,0,7,0,1,1,9,0

%N Irregular triangle read by rows: T(n,k) = number of times a gap of k occurs between the first n successive primes.

%H Robert Israel, <a href="/A277729/b277729.txt">Table of n, a(n) for n = 2..10032</a> (rows 2 to 410, flattened)

%e Triangle begins:

%e 1,

%e 1, 1,

%e 1, 2,

%e 1, 2, 0, 1,

%e 1, 3, 0, 1, <- gaps in 2,3,5,7,11,13 are 1, 2 (3 times), 4 (once)

%e 1, 3, 0, 2,

%e 1, 4, 0, 2,

%e 1, 4, 0, 3,

%e 1, 4, 0, 3, 0, 1,

%e 1, 5, 0, 3, 0, 1,

%e 1, 5, 0, 3, 0, 2,

%e 1, 5, 0, 4, 0, 2,

%e 1, 6, 0, 4, 0, 2,

%e 1, 6, 0, 5, 0, 2,

%e 1, 6, 0, 5, 0, 3,

%e 1, 6, 0, 5, 0, 4,

%e 1, 7, 0, 5, 0, 4,

%e 1, 7, 0, 5, 0, 5,

%e 1, 7, 0, 6, 0, 5,

%e 1, 8, 0, 6, 0, 5,

%e ...

%p N:= 30: # for rows 2 to N

%p res:= 1; p:= 3; R:= <1>;

%p for n from 2 to N do

%p pp:= nextprime(p);

%p d:= pp - p;

%p p:= pp;

%p if d <= LinearAlgebra:-Dimension(R) then

%p R[d]:= R[d]+1

%p else

%p R(d):= 1

%p fi;

%p res:= res, op(convert(R,list));

%p od:

%p res; # _Robert Israel_, Nov 16 2016

%Y Cf. A277730, A213930.

%K nonn,tabf

%O 2,5

%A _N. J. A. Sloane_, Nov 06 2016