|
|
A186143
|
|
a(n) is the smallest suffix such that the numbers with k digits "3" prepended are primes for k = 1, 2, ..., n.
|
|
3
|
|
|
|
OFFSET
|
1,8
|
|
COMMENTS
|
See A186142 for the digit "9" case. The corresponding sequences with the digits "1" or "7" are not possible because if Xn and XXn are prime, then XXXn will be a multiple of 3 when X is 1 or 7.
|
|
LINKS
|
|
|
EXAMPLE
|
a(7) = 1 because 31, 331, 3331, 33331, 333331, 3333331, 33333331 are primes.
|
|
MATHEMATICA
|
m=1; Table[While[d=IntegerDigits[m]; k=0; While[k++; PrependTo[d, 3]; k <=
n && PrimeQ[FromDigits[d]]]; k <= n, m++]; m, {n, 6}]
|
|
PROG
|
(Python)
from sympy import isprime
def a(n):
an = 0
while True:
an = an+1
while not all(isprime(int("3"*k+str(an))) for k in range(1, n+1)):
an += 1
return an
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,hard,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|