login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A350781 Primes p whose reverse q is a semiprime, and of p+q and its reverse one is a prime and the other is a semiprime. 1
419, 599, 647, 12497, 13487, 14461, 15467, 15991, 16981, 17431, 17551, 18097, 18521, 18541, 19087, 19427, 20921, 20929, 22039, 22349, 22501, 22567, 22621, 22669, 22859, 24091, 24329, 24799, 26099, 26209, 26297, 26309, 26399, 26501, 26557, 26699, 26711, 26849, 28019, 28051, 28537, 28597, 28669 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 647 is a term because 647 is prime, its reverse 746 = 2*373 is a semiprime, 647+746 = 1393 = 7*199 is a semiprime, and the reverse 3931 of 1393 is a prime.
MAPLE
filter:= proc(p) local q, r, s;
if not isprime(p) then return false fi;
q:= digrev(p);
if numtheory:-bigomega(q) <> 2 then return false fi;
r:= p+q;
s:= digrev(r);
{numtheory:-bigomega(r), numtheory:-bigomega(s)} = {1, 2}
end proc:
digrev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
select(filter, [seq(i, i=3..10^5, 2)]);
MATHEMATICA
semiQ[n_] := PrimeOmega[n] == 2; q1[p_] := PrimeQ[p] && semiQ[IntegerReverse[p]]; q2[p_] := semiQ[p] && PrimeQ[IntegerReverse[p]]; q[p_] := q1[p] && (q1[(s = p + IntegerReverse[p])] || q2[s]); Select[Range[30000], q] (* Amiram Eldar, Jan 16 2022 *)
PROG
(Python)
from sympy import isprime, factorint
def issemip(n): return sum(factorint(n).values()) == 2
def ok(p):
if not isprime(p): return False
q = int(str(p)[::-1])
if not issemip(q): return False
r = int(str(p+q)[::-1])
return (isprime(p+q) and issemip(r)) or (isprime(r) and issemip(p+q))
print([k for k in range(30000) if ok(k)]) # Michael S. Branicky, Jan 15 2022
CROSSREFS
Cf. A001358.
Subsequence of A085778.
Sequence in context: A292422 A328497 A138062 * A097233 A233551 A142281
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Jan 15 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 23:40 EDT 2024. Contains 371798 sequences. (Running on oeis4.)