login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A350216
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.
2
7, 19, 1, 173, 1547, 559667, 347707, 36695077, 139760989, 7931271479
OFFSET
1,1
COMMENTS
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.
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.
EXAMPLE
a(1) = 7 because 67 is prime while 667 = 23*29, and 7 is the smallest number with this property.
a(2) = 19 because 619 and 6619 are primes while 66619 = 7*31*307, and 19 is the smallest number with this property.
a(3) = 1 because 61, 661 and 6661 are primes while 66661 = 7*89*107, and 1 is the smallest number with this property.
PROG
(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))));
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("6"*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,more
AUTHOR
Bernard Schott, Dec 20 2021
EXTENSIONS
a(5)-a(7) from Michel Marcus, Dec 20 2021
a(8)-a(10) from Michael S. Branicky, Dec 20 2021
STATUS
approved