cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A158962 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.

This page as a plain text file.
%I A158962 #7 Apr 14 2021 19:16:31
%S A158962 3,4,4,444,827868,10387692,1885781034
%N A158962 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 A158962 All 4 numbers 444-1,444444-1,1+444444444-1,444444444444-1 are prime and 444
%e A158962 is the smallest such number so a(4)=444.
%p A158962 a:= proc(n) local m; for m do if andmap(isprime,
%p A158962       [seq(parse(cat(m$i))-1, i=1..n)]) then return m fi od
%p A158962     end:
%p A158962 seq(a(n), n=1..5);  # _Alois P. Heinz_, Apr 14 2021
%o A158962 (Python)
%o A158962 from sympy import isprime
%o A158962 def A158962(n):
%o A158962     m = 1
%o A158962     while True:
%o A158962         for i in range(n):
%o A158962             if not isprime(int(str(m)*(i+1))-1):
%o A158962                 break
%o A158962         else:
%o A158962             return m
%o A158962         m += 1 # _Chai Wah Wu_, Apr 14 2021
%Y A158962 Cf. A153434.
%K A158962 base,more,nonn
%O A158962 1,1
%A A158962 _Farideh Firoozbakht_, Apr 02 2009