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.

A330477 Semiprimes (A001358) p*q such that p*q+p+q is also a semiprime.

This page as a plain text file.
%I A330477 #18 Sep 22 2021 07:41:47
%S A330477 9,22,25,39,62,69,77,87,91,94,95,106,115,119,121,122,133,134,142,146,
%T A330477 159,183,187,202,213,214,218,219,226,235,237,249,253,259,262,265,274,
%U A330477 287,289,291,299,303,305,309,314,335,362,381,386,393,403,411,417,422,446,458,469,473,489,501,502,505
%N A330477 Semiprimes (A001358) p*q such that p*q+p+q is also a semiprime.
%H A330477 Robert Israel, <a href="/A330477/b330477.txt">Table of n, a(n) for n = 1..10000</a>
%e A330477 a(3) = 25 is a member because 25 = 5*5 and 25+5+5 = 5*7 is also a semiprime.
%p A330477 N:= 1000:
%p A330477 Primes:= select(isprime, [2,seq(i,i=3..N)]):
%p A330477 SP:= sort([seq(seq([p,q],q=select(t -> t >= p and p*t<=N, Primes)),p=Primes)],(a,b) -> a[1]*a[2]<b[1]*b[2]):
%p A330477 map(t -> t[1]*t[2], select(t -> numtheory:-bigomega(t[1]*t[2]+t[1]+t[2])=2, SP));
%t A330477 Select[Union@ Apply[Join, Table[Flatten@{p #, Sort[{p, #}]} & /@ Prime@ Range@ PrimePi@ Floor[Max[#]/p], {p, #}]] &@ Prime@ Range@ 97, PrimeOmega[Total@ #] == 2 &][[All, 1]] (* _Michael De Vlieger_, Dec 15 2019 *)
%o A330477 (PARI) issemi(n)=bigomega(n)==2
%o A330477 list(lim)=my(v=List()); forprime(p=2, sqrtint(lim\=1), forprime(q=p, lim\p, if(issemi(p*q+p+q), listput(v,p*q)))); Set(v) \\ _Charles R Greathouse IV_, Dec 16 2019
%o A330477 (Python)
%o A330477 from sympy import factorint
%o A330477 def is_semiprime(n): return sum(e for e in factorint(n).values()) == 2
%o A330477 def ok(n):
%o A330477     f = factorint(n, multiple=True)
%o A330477     if len(f) != 2: return False
%o A330477     p, q = f
%o A330477     return len(factorint(p*q + p + q, multiple=True)) == 2
%o A330477 print(list(filter(ok, range(506)))) # _Michael S. Branicky_, Sep 22 2021
%Y A330477 Cf. A001358.
%Y A330477 Contains A108570.
%K A330477 nonn
%O A330477 1,1
%A A330477 _J. M. Bergot_ and _Robert Israel_, Dec 15 2019