OFFSET
0,1
COMMENTS
LookAndSay(n) denotes the description of the digits of n. For example, LookAndSay(111223) = 312213. 2. There is no prime < 10^5 with echo = 6.
LINKS
Carlos Rivera, Puzzle 36. Sequences of "descriptive primes", The Prime Puzzles and Problems Connection.
Carlos Rivera, Puzzle 999. In Memoriam to John Horton Conway, The Prime Puzzles and Problems Connection.
EXAMPLE
233 is the smallest prime p such that p_0 = 233, p_1 = LookAndSay(233) = 1223, p_2 = LookAndSay(1223) = 112213.
PROG
(Python)
from sympy import isprime, nextprime
from itertools import groupby, islice
def LS(n):
return int(''.join(str(len(list(g)))+k for k, g in groupby(str(n))))
def f(n): return -1 if not isprime(n) else 1 + f(LS(n))
def agen(startn=0, startp=2):
n, p = startn, startp
while True:
fp = f(p)
while (fp >= n): n += 1; yield p
p = nextprime(p)
print(list(islice(agen(), 6))) # Michael S. Branicky, Jul 27 2022
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Joseph L. Pe, Jan 30 2003
EXTENSIONS
Corrected by Mark Hudson (mrmarkhudson(AT)hotmail.com), Feb 02 2003, who reports there are no more terms < 10^6.
a(6) (found by Walter Schneider) and a(7) from Giovanni Resta, May 09 2020
STATUS
approved