login
Position of n-th appearance of 2n in the sequence of prime gaps (A001223). If 2n does not appear at least n times, set a(n) = -1.
4

%I #6 Aug 08 2022 15:55:04

%S 2,6,15,79,68,121,162,445,416,971,836,987,2888,1891,1650,5637,5518,

%T 4834,9237,8152,10045,21550,20248,20179,29914,36070,24237,53355,52873,

%U 34206,103134,90190,63755,147861,98103,117467,209102,206423,124954,237847,369223

%N Position of n-th appearance of 2n in the sequence of prime gaps (A001223). If 2n does not appear at least n times, set a(n) = -1.

%C Prime gaps (A001223) are the differences between consecutive prime numbers. They begin: 1, 2, 2, 4, 2, 4, 2, 4, 6, ...

%e We need the first 15 prime gaps (1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6) before we reach the 3rd appearance of 6, so a(6) = 15.

%t nn=1000;

%t gaps=Differences[Array[Prime,nn]];

%t Table[Position[gaps,2*n][[n,1]],{n,Select[Range[nn],Length[Position[gaps,2*#]]>=#&]}]

%Y The first appearances are at A038664, seconds A356221.

%Y Diagonal of A356222.

%Y A001223 lists the prime gaps.

%Y A073491 lists numbers with gapless prime indices.

%Y A356224 counts divisors with gapless prime indices, complement A356225.

%Y A356226 = gapless interval lengths of prime indices, run-lengths A287170.

%Y Cf. A000005, A028334, A029709, A060681, A119313, A137921, A193829, A274121.

%K nonn

%O 1,1

%A _Gus Wiseman_, Aug 04 2022