This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A361267 #34 Feb 16 2025 08:34:05 %S A361267 3,4,5,6,7,12,13,19,25,26,27,28,43,44,48,49,59,63,64,69,88,89,112,116, %T A361267 142,143,147,148,151,152,181,182,206,211,212,224,225,229,234,235,236, %U A361267 253,261,264,276,285,286,287,301,302,313,314,322,332,336,352,384,389 %N A361267 Numbers k such that prime(k+2) - prime(k) = 6. %H A361267 Robert Israel, <a href="/A361267/b361267.txt">Table of n, a(n) for n = 1..10000</a> %H A361267 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimeTriplet.html">Prime Triplet</a> %H A361267 Wikipedia, <a href="https://en.wikipedia.org/wiki/Prime_triplet">Prime triplet</a> %F A361267 a(n) = A000720(A007529(n)). - _Alois P. Heinz_, Mar 06 2023 %p A361267 q:= n-> is(ithprime(n+2)-ithprime(n)=6): %p A361267 select(q, [$1..400])[]; # _Alois P. Heinz_, Mar 06 2023 %t A361267 Select[Range[400], Prime[# + 2] - Prime[#] == 6 &] (* _Michael De Vlieger_, Mar 06 2023 *) %t A361267 PrimePi/@(Select[Partition[Prime[Range[400]],3,1],#[[3]]-#[[1]]==6&][[;;,1]]) (* _Harvey P. Dale_, Sep 16 2023 *) %o A361267 (Clojure) %o A361267 (defn next-prime [n] %o A361267 (if (= n 2) %o A361267 3 %o A361267 (let [m (+ n 2) %o A361267 t (-> n Math/sqrt int (+ 2))] %o A361267 (if (some #(zero? (mod m %)) (range 2 t)) %o A361267 (next-prime m) %o A361267 m)))) %o A361267 (def primes (lazy-seq (iterate next-prime 2))) %o A361267 (defn triplet-primes-positions [n] %o A361267 (->> primes %o A361267 (take n) %o A361267 (partition 3 1) %o A361267 (map list (range)) %o A361267 (filter (fn [[i xs]] (= 6 (- (last xs) (first xs))))) %o A361267 (map #(-> % first inc)))) %o A361267 (println (triplet-primes-positions 2000)) %o A361267 (Python) %o A361267 from itertools import count, islice %o A361267 from sympy import nextprime, prime %o A361267 def A361267_gen(startvalue=1): # generator of terms >= startvalue %o A361267 p = prime(m:=max(startvalue,1)) %o A361267 q = nextprime(p) %o A361267 r = nextprime(q) %o A361267 for k in count(m): %o A361267 if r-p == 6: %o A361267 yield k %o A361267 p, q, r = q, r, nextprime(r) %o A361267 A361267_list = list(islice(A361267_gen(),20)) # _Chai Wah Wu_, Mar 27 2023 %Y A361267 Cf. A000040, A000720, A007529, A022004, A022005. %K A361267 nonn %O A361267 1,1 %A A361267 _Atabey Kaygun_, Mar 06 2023