A309067 Index of A053319(n) in A014574; -1 if it doesn't exist.
-1, 2, 2, 3, 3, 4, 3, 5, 2, 5, 3, 5, 3, 2, 5, 3, 5, 3, 5, -1, 8, 3, 5, 7, -1, 5, 4, -1, 4, 12, 3, 2, 5, -1, 11, 3, 4, 3, 5, 7, -1, -1, 3, 3, 4, 10, -1, 5, 2, -1, 3, -1, 5, -1, -1, -1, 2, -1, 4, -1, 5, -1, 2, -1, 4, 3, -1, 5, 6, 5, 6, -1, 6, -1, 5, -1, 4, 7, 3, -1, 5, -1, -1, -1, 2, 6, 5, 5, 3, 4
Offset: 1
Keywords
Programs
-
Mathematica
ind[v_, e_] := If[Length[(p = Position[v, ?(# == e &)])] == 0, -1, p[[1]]]; tpmidQ[n] := And @@ PrimeQ[n + {-1, 1}]; tp = Select[Range[10^4], tpmidQ]; d = Differences[tp]; ind[tp, #] & /@ d // Flatten (* Amiram Eldar, Jul 12 2019 *)