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.

Showing 1-5 of 5 results.

A115670 Semiprimes (A001358) whose digit reversal is prime.

Original entry on oeis.org

14, 34, 35, 38, 74, 91, 95, 106, 118, 119, 133, 134, 142, 145, 146, 166, 194, 301, 305, 334, 346, 358, 361, 362, 365, 371, 377, 382, 386, 391, 395, 703, 706, 713, 721, 731, 745, 746, 749, 755, 758, 763, 778, 779, 785, 791, 793, 799, 901, 905, 914, 917, 922
Offset: 1

Views

Author

Giovanni Resta, Jan 31 2006

Keywords

Examples

			35=5*7 is semiprime and 53 is prime.
		

Crossrefs

A367151 Primes whose reversals are triprimes.

Original entry on oeis.org

29, 67, 89, 139, 223, 227, 233, 239, 269, 271, 277, 281, 421, 457, 461, 467, 499, 521, 523, 571, 577, 613, 617, 619, 653, 659, 809, 839, 881, 883, 887, 1049, 1123, 1289, 1373, 1459, 1543, 1579, 1609, 1783, 2003, 2011, 2017, 2027, 2029, 2053, 2081, 2087, 2141, 2143, 2213, 2221, 2237, 2239, 2243
Offset: 1

Views

Author

Robert Israel, Nov 06 2023

Keywords

Examples

			a(3) = 89 is a term because 89 is a prime and its reversal 98 = 2*7^2 is the product of 3 primes, counted with multiplicity.
		

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    select(t -> isprime(t) and numtheory:-bigomega(rev(t)) = 3, [seq(i,i=3..10000,2)]);
  • Mathematica
    Select[Prime[Range[350]], PrimeOmega[FromDigits[Reverse[IntegerDigits[#]]]]==3&] (* Stefano Spezia, Nov 07 2023 *)
    Select[Prime[Range[400]],PrimeOmega[IntegerReverse[#]]==3&] (* Harvey P. Dale, Jan 10 2024 *)

A345346 Primes whose digit reversal is twice a prime.

Original entry on oeis.org

41, 43, 47, 83, 229, 241, 263, 283, 419, 431, 433, 439, 479, 491, 601, 607, 641, 643, 647, 661, 683, 811, 853, 857, 859, 877, 2039, 2063, 2069, 2083, 2099, 2203, 2207, 2251, 2273, 2281, 2287, 2411, 2417, 2423, 2437, 2467, 2473, 2617, 2621, 2663, 2671, 2677, 2683, 2687, 2689, 2801, 2819, 2837
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jun 14 2021

Keywords

Examples

			a(3) = 47 is a term because 47 and 74/2 = 37 are primes.
		

Crossrefs

Intersection of A085778 and A273892.

Programs

  • Maple
    revdigs:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    filter:= proc(n) isprime(n) and numtheory:-bigomega(revdigs(n))=2 end proc:
    select(filter, [seq(seq(seq(i*10^d+j,j=1..10^d-1,2),i=2..8,2),d=1..4)]);
  • PARI
    isok(p) = if (isprime(p), my(r=fromdigits(Vecrev(digits(p)))); if (!(r%2), isprime(r/2))); \\ Michel Marcus, Jun 15 2021
    
  • Python
    from sympy import isprime, primerange
    def ok(p): t = int(str(p)[::-1]); return t%2 == 0 and isprime(t//2)
    print(list(filter(ok, primerange(1, 2838)))) # Michael S. Branicky, Jun 16 2021

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 15 2022

Keywords

Examples

			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.
		

Crossrefs

Cf. A001358.
Subsequence of A085778.

Programs

  • 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 *)
    pspQ[p_]:=With[{q=IntegerReverse[p]},PrimeOmega[q]==2&&Sort[PrimeOmega/@{p+q,IntegerReverse[p+q]}]=={1,2}]; Select[Prime[ Range[ 3500]],pspQ] (* Harvey P. Dale, Mar 22 2025 *)
  • 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

A368238 Semiprimes whose reversal is a prime, ordered by the prime.

Original entry on oeis.org

91, 14, 34, 74, 35, 95, 38, 301, 901, 721, 731, 361, 371, 391, 791, 922, 142, 362, 382, 703, 713, 133, 943, 763, 973, 793, 914, 134, 334, 934, 974, 194, 305, 905, 145, 745, 755, 365, 965, 785, 395, 995, 106, 706, 146, 346, 746, 166, 386, 917, 377, 118, 358, 758, 958, 778, 119, 749, 779, 799, 3101
Offset: 1

Views

Author

Zak Seidov and Robert Israel, Dec 18 2023

Keywords

Examples

			a(4) = 74 because A115670(4) = 47 is the 4th prime whose reversal is a semiprime, and 74 is that reversal.
		

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,i;
           L:= convert(n,base,10);
           add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    map(rev, select(p -> isprime(p) and numtheory:-bigomega(rev(p)) = 2, [seq(i,i=3..1000,2)]);
  • Mathematica
    s = {}; Do[If[2 == PrimeOmega[sm = FromDigits[Reverse[IntegerDigits[Prime[k]]]]], AppendTo[s, sm]], {k, 200}]; s

Formula

a(n) = A004086(A085778(n)).
Showing 1-5 of 5 results.