login
A373693
a(n) is the least number k such that the number whose base-b representation is the same as the decimal representation of k is prime for the first n possible bases b, but not for the next possible base.
1
1, 11, 10, 65, 155, 3637, 5147, 321311, 1221221, 16355021, 2383157941, 40042844731, 35175032771
OFFSET
0,2
COMMENTS
Possible bases are those greater than the largest decimal digit of n.
For n >= 7, a(n) must end in 1.
EXAMPLE
a(3) = 65 because 65_7 = 47, 65_8 = 53 and 65_9 = 59 are prime but 65_10 = 65 is composite.
MAPLE
f:= proc(n) local L, x, i, b;
L:= convert(n, base, 10);
b:= max(L);
for i from 0 do
b:= b+1;
x:= add(L[i]*b^(i-1), i=1..nops(L));
if not isprime(x) then return i fi;
od
end proc:
V:= Array(0..9): V[0]:= 1: count:= 1:
for n from 10 while count < 10 do
v:= f(n);
if V[v] = 0 then V[v]:= n; count:= count+1; fi;
od:
convert(V, list);
PROG
(Python)
from gmpy2 import is_prime, mpz
def A373693(n): # assumes n <= 51
for k in count(1):
c = max(map(int, s:=str(k)))+1
if all(is_prime(mpz(s, b)) for b in range(c, c+n)) and not is_prime(mpz(s, c+n)):
return k # Chai Wah Wu, Aug 05 2024
CROSSREFS
Sequence in context: A360450 A061882 A323296 * A275782 A120005 A362335
KEYWORD
nonn,base,more
AUTHOR
Robert Israel, Aug 03 2024
EXTENSIONS
a(11)-a(12) from Michael S. Branicky, Aug 04 2024
STATUS
approved