login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A350214 a(n) is the smallest suffix such that the numbers with k digits "3" prepended are primes for k = 1, 2, ..., n but not for k = n+1. 3

%I #34 Dec 21 2021 07:20:13

%S 11,7,47,923,331,31,1,26009371,1233803717,24680858269

%N a(n) is the smallest suffix such that the numbers with k digits "3" prepended are primes for k = 1, 2, ..., n but not for k = n+1.

%C Variant of A186143 where the first 7 terms are equal to 1, then a(7) = A186143(7) = 1; also a(m) = A186143(m) for m = 8, 9, 10.

%C Unlike A186143, this sequence is not monotonic.

%e a(1) = 11 because 311 is prime while 3311 = 11 * 301, and 11 is the smallest number with this property.

%e a(2) = 7 because 37 and 337 are primes while 3337 = 47 * 71, and 7 is the smallest number with this property.

%e a(3) = 47 because 347, 3347 and 33347 are primes while 333347 = 7 * 7 * 6803, and 47 is the smallest number with this property.

%o (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))));

%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("3"*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. A186069, A186070, A186142, A186143, A350216.

%K nonn,base,hard,more

%O 1,1

%A _Bernard Schott_, Dec 19 2021

%E a(5)-a(10) from _Michael S. Branicky_, Dec 20 2021

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 16 19:55 EDT 2024. Contains 375977 sequences. (Running on oeis4.)