%I #33 Aug 30 2022 14:27:03
%S 1,7,111,3367,7787,8517,9071,54079,54451,138657,262157,759461,857817,
%T 4662317,21754021,25400729,41171387,50304331,368119693,799245603,
%U 938577991
%N Numbers k that set a new record m where m is the largest left-truncatable prime up to the final k (stop on reaching the final k).
%C If instead of comparing the values of m, we compare the number of digits concatenated to k, then there are only 3 known terms: 1, 7 and 50304331 with 19, 23 and 24 digits respectively.
%e a(1) = 1 because 1 sets a record m = 89726156799336363541 and 89726156799336363541, 9726156799336363541, 726156799336363541, 26156799336363541, 6156799336363541, 156799336363541, 56799336363541, 6799336363541, 799336363541, 99336363541, 9336363541, 336363541, 36363541, 6363541, 363541, 63541, 3541, 541, 41 are all primes (the truncation stops when the final k is reached).
%e a(2) = 7 because for k = 2..6 no m exceeds 89726156799336363541, but for k = 7, m = 357686312646216567629137.
%o (Python)
%o from sympy import isprime
%o def findNewCandidates(candidates):
%o newCandidates = []
%o for candidate in candidates:
%o for k in range(1,10):
%o p = int(str(k) + str(candidate))
%o if (isprime(p)):
%o newCandidates.append(p)
%o return newCandidates
%o record = 0
%o for k in range(1, 10**6):
%o if (k % 2 == 0 or k % 5 == 0):
%o continue
%o toCheck = [k]
%o while len(toCheck) > 0:
%o lastToCheck = toCheck
%o toCheck = findNewCandidates(toCheck)
%o result = lastToCheck[-1]
%o if (result > record):
%o record = result
%o print(str(k))
%Y Cf. A024785.
%K nonn,base,more
%O 1,2
%A _Eder Vanzei_, Jul 02 2022
%E a(15)-a(18) from _Michael S. Branicky_, Jul 02 2022
%E a(19)-a(21) from _Michael S. Branicky_, Jul 04 2022