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 A386540 #35 Aug 04 2025 09:02:04 %S A386540 37,2557,3061,5581,88741,124021,157081,178537,216217,216757,217057, %T A386540 330661,344821,352081,387577,423481,459397,477577,521137,790861, %U A386540 806521,865957,869521,1369657,1517881,1673401,1704397,1710661,1970257,2132797,2292781,2361781,2680141 %N A386540 Primes p such that 2p - 1, 3p - 2, (p + 1)/2, and (p + 2)/3 are also prime. %C A386540 All terms are congruent to 1 modulo 12. %C A386540 Let q = (p + 1)/2 and r = (p + 2)/3; then 3r = 2q + 1. %H A386540 Robert Israel, <a href="/A386540/b386540.txt">Table of n, a(n) for n = 1..1000</a> %e A386540 37 is a term, since it is prime and 2*37 - 1 = 73, 3*37 - 2 = 109, (37 + 1)/2 = 19 and (37 + 2)/3 = 13 are all prime. %p A386540 select(p -> andmap(isprime,[p, 2*p-1,3*p-2,(p+1)/2,(p+2)/3]), [seq(1+12*i,i=1..10^6)]); # _Robert Israel_, Jul 25 2025 %t A386540 Select[Prime[Range[2*10^5]],AllTrue[{2#-1,3#-2,(#+1)/2,(#+2)/3},PrimeQ]&] (* _James C. McMahon_, Jul 25 2025 *) %o A386540 (Python) %o A386540 from gmpy2 import is_prime %o A386540 def ok(p): return p&1 and p%3 == 1 and all(is_prime(q) for q in [p, 2*p-1, 3*p-2, (p+1)//2, (p+2)//3]) %o A386540 print([k for k in range(1, 10**7, 12) if ok(k)]) # _Michael S. Branicky_, Jul 25 2025 %Y A386540 Intersection of A036570 and A174734. %K A386540 nonn,easy %O A386540 1,1 %A A386540 _Holger Wallenta_, Jul 25 2025