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.

A056815 Primes with prime "look and say" descriptions.

This page as a plain text file.
%I A056815 #30 Feb 03 2023 15:41:11
%S A056815 3,7,17,23,113,127,137,193,199,223,233,271,311,313,331,359,367,373,
%T A056815 431,433,439,463,479,499,503,523,587,607,641,677,691,733,757,773,797,
%U A056815 809,821,823,829,853,919,997,1009,1069,1123,1129,1171,1181,1187,1223,1277
%N A056815 Primes with prime "look and say" descriptions.
%C A056815 The "look and say" descriptions of some of these primes are themselves also terms of this sequence (for example, the one for 373). - _Alonso del Arte_, Mar 01 2012
%D A056815 David Wells, Prime Numbers: The Most Mysterious Figures in Math. Hoboken, New Jersey: John Wiley & Sons (2005): 41.
%H A056815 Reinhard Zumkeller, <a href="/A056815/b056815.txt">Table of n, a(n) for n = 1..10000</a>
%F A056815 A010051(a(n)) * A010051(A045918(a(n))) = 1. - _Reinhard Zumkeller_, Apr 14 2014
%e A056815 193 is prime and its "look and say" description A045918(193) = 111913, is also prime, so 193 belongs to the sequence.
%t A056815 LookAndSayA[ n_] := FromDigits@Flatten@((Through[ {Length, First}[ # ] ] &) /@ Split@IntegerDigits@n); Select[Prime@Range[210], PrimeQ@LookAndSayA@# &] (* _Ray Chandler_, Jan 12 2007 *)
%t A056815 (* _Emmanuel Vantieghem_, Jan 26 2012, reports that the above Mma program is incorrect, because the LookAndSayA function can give wrong answers. Here is a better function (b and c to be substituted by suitable numbers): *)
%t A056815 LookAndSayA[n_] := FromDigits@Flatten@(IntegerDigits/@Flatten@
%t A056815 ((Through[{Length, First}[#]]&)/@Split@IntegerDigits@n)); W=Select[Prime@Range[b, c], PrimeQ@LookAndSayA@#&]
%t A056815 (* _Robert G. Wilson v_ then commented (Jan 27 2012) that the following version is cleaner: *)
%t A056815 LookAndSayA[n_] := FromDigits@ Flatten@ IntegerDigits@ Flatten[
%t A056815 Through[{Length, First}[#]] & /@ Split@ IntegerDigits@ n]
%o A056815 (PARI) forprime(p=1,999, isprime(A045918(p)) & print1(p","))  \\ _M. F. Hasler_, Jan 27 2012
%o A056815 (Haskell)
%o A056815 a056815 n = a056815_list !! (n-1)
%o A056815 a056815_list = filter ((== 1) . a010051' . a045918) a000040_list
%o A056815 -- _Reinhard Zumkeller_, Apr 14 2014
%o A056815 (Python)
%o A056815 from sympy import isprime, sieve
%o A056815 from itertools import groupby, islice
%o A056815 def LS(n): return int(''.join(str(len(list(g)))+k for k, g in groupby(str(n))))
%o A056815 def agen(): yield from (p for p in sieve if isprime(LS(p)))
%o A056815 print(list(islice(agen(), 51))) # _Michael S. Branicky_, Feb 03 2023
%Y A056815 Cf. A045918, A005150, A127175, A127176.
%Y A056815 Cf. A127355.
%K A056815 base,nonn
%O A056815 1,1
%A A056815 _Joseph L. Pe_, Jan 30 2003
%E A056815 Discussion of Mma program added Feb 02 2012 by _N. J. A. Sloane_