[seqfan] Sequence A056815

Emmanuel Vantieghem emmanuelvantieghem at gmail.com
Thu Jan 26 21:57:19 CET 2012


Dear Sir,



This concerns sequence  A056815 <http://oeis.org/A056815>  at the OEIS.



The Mathematica program sounds as follows :

LookAndSayA[n_]:=FromDigits at Flatten@((Through[{Length,First}[
#]]&)/@Split at IntegerDigits@n);Select[Prime at Range[210], PrimeQ at LookAndSayA@#&].


The output of the program is correct, but errors will happen if one runs it
for numbers with digits that are repeated more than 10 times.

Example.  If we replace

             Prime at Range[210]

by

      Prime at Range[712142837439,712142837440]

the output is

             {21111111111121},

which would mean that the sequence A056815 contains the prime p =
21111111111121.

However, the exact 'look and say' value of  p  is  121111211, which is not
prime.  Thus, A056815 does not contain the prime  p !

The reason is that the value returned by the function LookAndSayA at p
is 13111211,
which is not correct.

The program could be repaired as follows (b and c to be substituted by
suitable numbers) :

LookAndSayA[n_]:=FromDigits at Flatten@(IntegerDigits/@Flatten@
((Through[{Length,First}[#]]&)/@Split at IntegerDigits@n));W=Select[Prime at Range
[b,c],PrimeQ at LookAndSayA@#&].


Sincere greetings.

Emmanuel Vantieghem.



More information about the SeqFan mailing list