cp's OEIS Frontend

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.

A363188 Prime numbers that are the exact average of four consecutive odd semiprimes.

This page as a plain text file.
%I A363188 #18 Jul 05 2023 12:18:56
%S A363188 53,67,89,199,223,277,349,439,449,461,487,491,499,523,557,569,643,683,
%T A363188 877,883,929,941,1069,1153,1259,1361,1471,1487,1733,1787,1901,1933,
%U A363188 1951,2111,2129,2251,2297,2311,2371,2521,2557,2689,2777,2797,2861,2917,2939,3037,3041,3253,3259,3271,3407
%N A363188 Prime numbers that are the exact average of four consecutive odd semiprimes.
%e A363188 53 is a term because (49 + 51 + 55 + 57)/4 = 53 is prime.
%e A363188 67 is a term because (57 + 65 + 69 + 77)/4 = 67 is prime.
%p A363188 OP:= select(isprime,[seq(i,i=3..10000,2)]):
%p A363188 OSP:= sort(select(`<=`,[seq(seq(OP[i]*OP[j],j=1..i),i=1..nops(OP))],3*OP[-1])):
%p A363188 SA:= [seq(add(OSP[i+j],j=0..3)/4,i=1..nops(OSP)-3)]:
%p A363188 select(t -> t::integer and isprime(t), SA); # _Robert Israel_, May 21 2023
%t A363188 Select[Plus @@@ Partition[Select[Range[1, 3500, 2], PrimeOmega[#] == 2 &], 4, 1] / 4, PrimeQ] (* _Amiram Eldar_, May 21 2023 *)
%o A363188 (Python)
%o A363188 from itertools import count, islice
%o A363188 from sympy import factorint, isprime
%o A363188 def semiprime(n): return sum(e for e in factorint(n).values()) == 2
%o A363188 def nextoddsemiprime(n): return next(k for k in count(n+1+(n&1), 2) if semiprime(k))
%o A363188 def agen(): # generator of terms
%o A363188     osp = [9, 15, 21, 25]
%o A363188     while True:
%o A363188         q, r = divmod(sum(osp), len(osp))
%o A363188         if r == 0 and isprime(q):
%o A363188             yield q
%o A363188         osp = osp[1:] + [nextoddsemiprime(osp[-1])]
%o A363188 print(list(islice(agen(), 53))) # _Michael S. Branicky_, May 21 2023
%Y A363188 Cf. A000040, A046315.
%Y A363188 Cf. A363074, A363187.
%K A363188 nonn
%O A363188 1,1
%A A363188 _Elmo R. Oliveira_, May 20 2023