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.

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