OFFSET
1,1
COMMENTS
EXAMPLE
a(1) = 11 because 311 is prime while 3311 = 11 * 301, and 11 is the smallest number with this property.
a(2) = 7 because 37 and 337 are primes while 3337 = 47 * 71, and 7 is the smallest number with this property.
a(3) = 47 because 347, 3347 and 33347 are primes while 333347 = 7 * 7 * 6803, and 47 is the smallest number with this property.
PROG
(PARI) isok(k, n)= my(s=Str(k)); for (i=1, n, s = concat("3", s); if (!isprime(eval(s)), return(0))); return (!isprime(eval(concat("3", s))));
a(n) = my(k=1); while(! isok(k, n), k++); k; \\ Michel Marcus, Dec 20 2021
(Python)
from sympy import isprime
def a(n):
an = 0
while True:
an, k = an+1, 1
while isprime(int("3"*k+str(an))): k += 1
if k-1 == n: return an
print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Dec 20 2021
CROSSREFS
KEYWORD
nonn,base,hard,more
AUTHOR
Bernard Schott, Dec 19 2021
EXTENSIONS
a(5)-a(10) from Michael S. Branicky, Dec 20 2021
STATUS
approved