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-1 of 1 results.

A359840 Numbers k that are the representation of primes in base 4 and in base 5.

Original entry on oeis.org

2, 3, 23, 131, 133, 221, 1211, 1231, 2023, 2111, 2113, 2311, 3013, 3211, 3233, 3323, 10031, 10033, 10121, 12011, 12121, 13223, 13331, 20131, 20203, 22111, 23233, 31313, 32033, 32303, 33133, 33331, 100123, 100211, 100231, 101003, 101333, 103333, 110021, 111211
Offset: 1

Views

Author

Bernard Schott, Jan 15 2023

Keywords

Comments

For a(1) = 2, 2_4 = 2_5 = 2_10 and for a(2) = 3, 3_4 = 3_5 = 3_10; otherwise, these two primes are distinct for n >= 3 (example).
The corresponding sequences of primes are A235474 (for base 4) and A235615 (for base 5).

Examples

			a(3) = 23 because 23_4 = 11_10 = A235474(3) and 23_5 = 13_10 = A235615(3) are primes.
a(9) = 2023 because 2023_4 = 139_10 = A235474(9) and 2023_5 = 263_10 = A235615(9) are primes.
		

Crossrefs

Intersection of A004678 and A004679.

Programs

  • Mathematica
    q[n_, b_] := Max[d = IntegerDigits[n]] < b && PrimeQ[FromDigits[d, b]]; Select[Range[200000], q[#, 4] && q[#, 5] &] (* Amiram Eldar, Jan 15 2023 *)
  • Python
    from sympy import isprime
    def ok(n): return max(s:=str(n)) < '4' and isprime(int(s, 4)) and isprime(int(s, 5))
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Jan 15 2023
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen(): yield from (int(s) for d in count(1) for f in "123" for r in product("0123", repeat=d-1) if isprime(int(s:=f+"".join(r), 4)) and isprime(int(s, 5)))
    print(list(islice(agen(), 40))) # Michael S. Branicky, Jan 15 2023

Formula

a(n) = A007090(A235474(n)); a(n) = A007091(A235615(n)).

Extensions

More terms from Amiram Eldar, Jan 15 2023
Showing 1-1 of 1 results.