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.

A001140 Describe the previous term! (method A - initial term is 4).

This page as a plain text file.
%I A001140 #58 Jul 29 2024 08:43:43
%S A001140 4,14,1114,3114,132114,1113122114,311311222114,13211321322114,
%T A001140 1113122113121113222114,31131122211311123113322114,
%U A001140 132113213221133112132123222114,11131221131211132221232112111312111213322114,31131122211311123113321112131221123113111231121123222114
%N A001140 Describe the previous term! (method A - initial term is 4).
%C A001140 Method A = 'frequency' followed by 'digit'-indication.
%C A001140 A001155, A001140, A001141, A001143, A001145, A001151 and A001154 are all identical apart from the last digit of each term (the seed). This is because digits other than 1, 2 and 3 never arise elsewhere in the terms (other than at the end of each of them) of look-and-say sequences of this type (as is mentioned by _Carmine Suriano_ in A006751). - _Chayim Lowen_, Jul 16 2015
%C A001140 a(n+1) - a(n) is divisible by 10^5 for n > 5. - _Altug Alkan_, Dec 04 2015
%D A001140 S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
%D A001140 I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.
%H A001140 T. D. Noe, <a href="/A001140/b001140.txt">Table of n, a(n) for n=1..20</a>
%H A001140 J. H. Conway, <a href="http://dx.doi.org/10.1007/978-1-4612-4808-8_53">The weird and wonderful chemistry of audioactive decay</a>, in T. M. Cover and Gopinath, eds., Open Problems in Communication and Computation, Springer, NY 1987, pp. 173-188.
%H A001140 S. R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/constant/cnwy/cnwy.html">Conway's Constant</a> [Broken link]
%H A001140 S. R. Finch, <a href="http://web.archive.org/web/20010207194413 /http://www.mathsoft.com/asolve/constant/cnwy/cnwy.html">Conway's Constant</a> [From the Wayback Machine]
%e A001140 The term after 3114 is obtained by saying "one 3, two 1's, one 4", which gives 132114.
%t A001140 RunLengthEncode[ x_List ] := (Through[ {First, Length}[ #1 ] ] &) /@ Split[ x ];
%t A001140 LookAndSay[ n_, d_:1 ] := NestList[ Flatten[ Reverse /@ RunLengthEncode[ # ] ] &, {d}, n - 1 ];
%t A001140 F[ n_ ] := LookAndSay[ n, 4 ][ [ n ] ];
%t A001140 Table[ FromDigits[ F[ n ] ], {n, 1, 11} ] (* _Zerinvary Lajos_, Mar 21 2007 *)
%o A001140 (Haskell) cf. Josh Triplett's program for A005051.
%o A001140 import Data.List (group)
%o A001140 a001140 n = a001140_list !! (n-1)
%o A001140 a001140_list = 4 : map say a001140_list where
%o A001140    say = read . concatMap saygroup . group . show
%o A001140          where saygroup s = (show $ length s) ++ [head s]
%o A001140 -- _Reinhard Zumkeller_, Dec 15 2012
%o A001140 (Perl)
%o A001140 # This outputs the first n elements of the sequence, where n is given on the command line.
%o A001140 $s = 4;
%o A001140 for (2..shift @ARGV) {
%o A001140     print "$s, ";
%o A001140     $s =~ s/(.)\1*/(length $&).$1/eg;
%o A001140 }
%o A001140 print "$s\n";
%o A001140 ## Arne 'Timwi' Heizmann (timwi(AT)gmx.net), Mar 12 2008
%Y A001140 Cf. A001155, A005150, A006751, A006715, A001141, A001143, A001145, A001151, A001154.
%K A001140 nonn,base,easy,nice
%O A001140 1,1
%A A001140 _N. J. A. Sloane_