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.

A109308 Lesser emirps (primes whose digit reversal is a larger prime).

Original entry on oeis.org

13, 17, 37, 79, 107, 113, 149, 157, 167, 179, 199, 337, 347, 359, 389, 709, 739, 769, 1009, 1021, 1031, 1033, 1061, 1069, 1091, 1097, 1103, 1109, 1151, 1153, 1181, 1193, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1279, 1283, 1381, 1399, 1409, 1429
Offset: 1

Views

Author

Zak Seidov, Jun 25 2005

Keywords

Crossrefs

Cf. A006567 (emirps), A109309 (larger emirps).

Programs

  • Maple
    read("transforms"):
    A109308 := proc(n)
        option remember;
        local p,R ;
        if n = 1 then
            return 13 ;
        else
            p := nextprime(procname(n-1)) ;
            while true do
                R := digrev(p) ;
                if R> p and isprime(R) then
                    return p;
                end if;
                p := nextprime(p) ;
            end do:
        end if;
    end proc: # R. J. Mathar, Oct 12 2012
  • Mathematica
    dr[n_]:=FromDigits[Reverse[IntegerDigits[n]]];Select[Prime[Range[1000]], PrimeQ[dr[ # ]]&&dr[ # ]>#&]
  • PARI
    isok(p) = if (isprime(p), my(q=fromdigits(Vecrev(digits(p)))); (p < q) && isprime(q)); \\ Michel Marcus, Sep 07 2021
    
  • Python
    from sympy import isprime, primerange
    def ok(p): revp = int(str(p)[::-1]); return p < revp and isprime(revp)
    print(list(filter(ok, primerange(1, 1430)))) # Michael S. Branicky, Sep 07 2021