OFFSET
1,1
COMMENTS
Primes whose hexadecimal representation contains only the "digits" B, C, D and F.
There are no primes whose hexadecimal representation contains only the vowels A and E (for these would be even numbers greater than 2).
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..21472 (all terms with <= 9 hexadecimal digits; terms 1..166 from N. J. A. Sloane)
EXAMPLE
The first few terms and their hexadecimal representations (written with least significant "digit" on the left) are:
11, [B]
13, [D]
191, [F, B]
223, [F, D]
251, [B, F]
3019, [B, C, B]
3023, [F, C, B]
3037, [D, D, B]
3067, [B, F, B]
3259, [B, B, C]
3323, [B, F, C]
...
PROG
(Python)
from sympy import isprime, primerange
def ok(p): return set(hex(p)[2:]) <= set("bcdf")
def aupton(limit): return [p for p in primerange(1, limit+1) if ok(p)]
print(aupton(769487)) # Michael S. Branicky, Nov 13 2021
(Python) # faster version for going to large numbers
from sympy import isprime
from itertools import product
def auptohd(m): # terms up to m hex digits
return [t for t in (int("".join(p), 16) for d in range(1, m+1) for p in product("bcdf", repeat=d)) if isprime(t)]
print(auptohd(7)) # Michael S. Branicky, Nov 13 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Feb 19 2014, corrected Feb 20 2014
STATUS
approved