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.

A054258 Concatenation of n in base 2 up to base 10 and n in base 10 down to base 2 is prime, all numbers are interpreted as decimals.

Original entry on oeis.org

2607, 4007, 4069, 7597, 12411, 13583, 23041, 31113, 32619, 46187, 48469, 55777, 61411, 64387, 71143, 73837, 84761, 103559, 123797, 124043, 126613, 136509, 142019, 147449, 183981, 186889, 200183, 204219, 214819, 221101, 224123, 230977, 235493, 249049, 256489
Offset: 1

Views

Author

Patrick De Geest, Feb 15 2000

Keywords

Examples

			a(1) = 2607 is a term since both 10100010111110120120220233404122002310413505735162607 and
  26073516505710413200234041222023310120120101000101111 are prime.
		

Crossrefs

Intersection of A054256 and A054257.

Programs

  • Mathematica
    Select[Range[250000],AllTrue[{FromDigits[Flatten[Table[IntegerDigits[#,b],{b,2,10}]]],FromDigits[ Flatten[Table[IntegerDigits[#,b],{b,10,2,-1}]]]},PrimeQ]&] (* Harvey P. Dale, May 28 2023 *)
  • Python
    from gmpy2 import digits, is_prime
    def ok(n): return is_prime(int("".join(digits(n, b) for b in list(range(2, 11))))) and is_prime(int("".join(digits(n, b) for b in list(range(10, 1, -1)))))
    print([k for k in range(234567) if ok(k)]) # Michael S. Branicky, May 28 2023

Extensions

Offset changed to 1 and a(33) and beyond from Michael S. Branicky, May 28 2023