%I #24 Aug 01 2023 15:36:52
%S 7,19,1,173,1547,559667,347707,36695077,139760989,7931271479
%N a(n) is the smallest suffix such that the numbers with k digits "6" prepended are primes for k = 1, 2, ..., n but not for k = n+1.
%C Similar sequences exist only for the digits "3" (A186143, A350214) and "9" (A186142): the corresponding sequences with the digits "1", "2", "4", "5", "7" or "8" are not possible because if Xn and XXn are prime, then XXXn will be a multiple of 3 when X = 1, 2, 4, 5, 7 or 8.
%C When a'(n) is the smallest suffix as in the Name but without "not for k = n+1", then the data becomes: 1, 1, 1, 173, ... In this case, a'(1) = 1 because 61 is prime, and 1 is the smallest number with this property.
%e a(1) = 7 because 67 is prime while 667 = 23*29, and 7 is the smallest number with this property.
%e a(2) = 19 because 619 and 6619 are primes while 66619 = 7*31*307, and 19 is the smallest number with this property.
%e a(3) = 1 because 61, 661 and 6661 are primes while 66661 = 7*89*107, and 1 is the smallest number with this property.
%o (PARI) isok(k, n)= my(s=Str(k)); for (i=1, n, s = concat("6", s); if (!isprime(eval(s)), return(0))); return (!isprime(eval(concat("6", s))));
%o a(n) = my(k=1); while(! isok(k,n), k++); k; \\ _Michel Marcus_, Dec 20 2021
%o (Python)
%o from sympy import isprime
%o def a(n):
%o an = 0
%o while True:
%o an, k = an+1, 1
%o while isprime(int("6"*k+str(an))): k += 1
%o if k-1 == n: return an
%o print([a(n) for n in range(1, 8)]) # _Michael S. Branicky_, Dec 20 2021
%Y Cf. A186142, A186143, A350214.
%K nonn,base,more
%O 1,1
%A _Bernard Schott_, Dec 20 2021
%E a(5)-a(7) from _Michel Marcus_, Dec 20 2021
%E a(8)-a(10) from _Michael S. Branicky_, Dec 20 2021