login
a(n) is the smallest number m such that all n numbers m-1, m.m-1, ..., m.m. .. .m-1 are prime, where dot means concatenation.
1

%I #7 Apr 14 2021 19:16:31

%S 3,4,4,444,827868,10387692,1885781034

%N a(n) is the smallest number m such that all n numbers m-1, m.m-1, ..., m.m. .. .m-1 are prime, where dot means concatenation.

%e All 4 numbers 444-1,444444-1,1+444444444-1,444444444444-1 are prime and 444

%e is the smallest such number so a(4)=444.

%p a:= proc(n) local m; for m do if andmap(isprime,

%p [seq(parse(cat(m$i))-1, i=1..n)]) then return m fi od

%p end:

%p seq(a(n), n=1..5); # _Alois P. Heinz_, Apr 14 2021

%o (Python)

%o from sympy import isprime

%o def A158962(n):

%o m = 1

%o while True:

%o for i in range(n):

%o if not isprime(int(str(m)*(i+1))-1):

%o break

%o else:

%o return m

%o m += 1 # _Chai Wah Wu_, Apr 14 2021

%Y Cf. A153434.

%K base,more,nonn

%O 1,1

%A _Farideh Firoozbakht_, Apr 02 2009