|
|
A359840
|
|
Numbers k that are the representation of primes in base 4 and in base 5.
|
|
0
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
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).
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
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.
|
|
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 *)
|
|
PROG
|
(Python)
from sympy import isprime
def ok(n): return max(s:=str(n)) < '4' and isprime(int(s, 4)) and isprime(int(s, 5))
(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)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|