login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A277729 Irregular triangle read by rows: T(n,k) = number of times a gap of k occurs between the first n successive primes. 2

%I

%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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 23 17:33 EST 2022. Contains 350514 sequences. (Running on oeis4.)