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.

A360147 Primes in base 10 that are also prime when read in a smaller base that is one plus the largest digit in the prime in base 10.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 23, 31, 37, 43, 61, 73, 101, 103, 107, 113, 131, 151, 223, 227, 233, 241, 251, 277, 307, 311, 331, 337, 373, 401, 461, 463, 467, 521, 547, 557, 577, 661, 673, 701, 827, 887, 1013, 1033, 1103, 1151, 1181, 1213, 1223, 1231, 1301, 1327, 1567
Offset: 1

Views

Author

Alfred Jacob Mohan, Jan 27 2023

Keywords

Crossrefs

Subsequence of A038617.

Programs

  • Maple
    q:= n-> isprime(n) and (l-> (d-> d<9 and isprime(add(l[i]*
       (d+1)^(i-1), i=1..nops(l))))(max(l)))(convert(n, base, 10)):
    select(q, [$1..2000])[];  # Alois P. Heinz, Jan 27 2023
  • Mathematica
    q[p_] := Module[{d = IntegerDigits[p], b}, b = Max[d] + 1; b <= 9 && PrimeQ[FromDigits[d, b]]]; Select[Prime[Range[250]], q] (* Amiram Eldar, Jan 27 2023 *)
  • PARI
    isok(p)=if(isprime(p), my(v=digits(p), b=vecmax(v)+1); b<10 && isprime(fromdigits(v,b)), 0) \\ Andrew Howroyd, Jan 27 2023
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        s = str(n)
        b = int(max(s)) + 1
        return b != 10 and isprime(int(s, b))
    print([k for k in range(1600) if ok(k)]) # Michael S. Branicky, Jan 27 2023
    

Extensions

More terms from Michael S. Branicky, Jan 27 2023