OFFSET
2,1
COMMENTS
Since a(n) must be a valid base-2 integer, it can only have digits 0 and 1.
EXAMPLE
a(4) = 101111 because 101111 interpreted in base-2 is 47 (prime), base-3 is 283 (prime), base-4 is 1109 (prime), but base-5 is 3281 (not prime).
MAPLE
V:= Vector(9): count:= 0:
f:= proc(n) local L, P, x, b, i;
L:= convert(n, base, 10);
P:= add(L[i]*x^(i-1), i=1..nops(L));
for b from 2 do if not isprime(eval(P, x=b)) then return b-1 fi od
end proc:
for i from 1 while count < 8 do
X:= convert(i, binary);
v:= f(X);
if v >= 1 and v <= 9 and V[v] = 0 then
V[v]:= X;
count:= count+1;
fi
od:
convert(V[2..9], list);
PROG
(Python)
from sympy import isprime
from itertools import count, islice, product
def f(s): return next(b-1 for b in count(2) if not isprime(int(s, b)))
def agen():
n, adict = 2, {2:11, 3:10}
for d in count(3):
for b in product("01", repeat=d-2):
s = "1" + "".join(b) + "1"
v = f(s)
if v not in adict: adict[v] = int(s)
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 7))) # Michael S. Branicky, Feb 09 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Feb 09 2023
EXTENSIONS
a(10)-a(12) using A086884 from Michael S. Branicky, Feb 09 2023
STATUS
approved