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 A256620 #39 May 22 2025 10:21:42 %S A256620 12,30,42,312,600,858,1032,1290,1698,2112,2688,3768,4218,4230,4260, %T A256620 5850,6132,6552,6702,7212,7308,8292,9420,9930,11970,12042,12378,15972, %U A256620 17190,17598,17922,19470,19890,21600,24180,26862,30012,30852,32118 %N A256620 Numbers n such that n is both the average of some twin prime pair p, q (q = p+2) (i.e., n = p+1 = q-1) and is also the arithmetic mean of the four numbers consisting of the two primes before p and the two primes after q. %C A256620 This sequence is a subsequence A014574 (average of twin prime pairs). %C A256620 All terms are multiples of 6. - _Zak Seidov_, Apr 25 2015 %H A256620 Karl V. Keller, Jr., <a href="/A256620/b256620.txt">Table of n, a(n) for n = 1..500000</a> %H A256620 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/TwinPrimes.html">Twin Primes</a> %e A256620 For n=12: 5,7,11,13,17,19 are six consecutive primes with 13 = 11 + 2 and (5+7+17+19)/4=12. %e A256620 For n=1032: 1019,1021,1031,1033,1039,1049 are six consecutive primes with 1033 = 1031 + 2 and (1019+1021+1039+1049)/4=1032. %t A256620 avQ[lst_]:=Module[{td=TakeDrop[lst,{3,4}]},Mean[td[[1]]]==Mean[td[[2]]] && td[[1,2]]-td[[1,1]]==2]; Mean[Take[#,{3,4}]]&/@Select[Partition[ Prime[ Range[ 3500]],6,1],avQ] (* The program uses the TakeDrop function from Mathematica version 10.2 *) (* _Harvey P. Dale_, Jul 16 2015 *) %o A256620 (Python) %o A256620 from sympy import isprime,prevprime,nextprime %o A256620 for i in range(5,200001,2): %o A256620 if isprime(i) and isprime(i+2): %o A256620 a = prevprime(i) %o A256620 b = prevprime(a) %o A256620 if a+b+nextprime(i,2)+nextprime(i,3) == 4*(i+1): print(i+1,end=', ') %o A256620 else: continue %Y A256620 Cf. A077800 (twin primes), A014574. %K A256620 nonn %O A256620 1,1 %A A256620 _Karl V. Keller, Jr._, Apr 24 2015 %E A256620 Typo in Name fixed by _Zak Seidov_, Apr 25 2015