<?xml version="1.0" encoding="windows-1252"?>
<node id="442322" title="Conway's audioactive sequence oneliner" created="2005-03-25 08:20:59" updated="2005-08-09 13:33:26">
<type id="1042">
CUFP</type>
<author id="409850">
blazar</author>
<data>
<field name="doctext">
I was thinking about &lt;A HREF="http://www.google.com/search?q=conway+audioactive"&gt;Conway's audioactive sequence&lt;/A&gt; and how easy it would be to write a perl program generating it. Well, here it is, as a oneliner:

&lt;CODE&gt;
perl -e '$_=1;print,s/((\d)\2*)/(length$1).$2/ge while~&lt;&gt;'
&lt;/CODE&gt;

(this waits for user to press return before emitting the next term of the sequence.)

&lt;P&gt;By comparison see e.g. this &lt;A HREF="http://soy.dyndns.org/~peter/projects/math/audioactive/"&gt;link&lt;/A&gt;. (Please note however that it's just a random hit from Google: don't consider it to have an absolute indicative power.)</field>
</data>
</node>
