[seqfan] Re: Need more terms for the Linus and Sally sequences

Neil Sloane njasloane at gmail.com
Tue Jun 23 14:25:52 CEST 2015


Robert, Hugo,
Many thanks for extending those sequences. Good to have 50K terms.
Hugo, I took the liberty of adding your remarks about using perl (to A006345)
Best regards
Neil

Neil J. A. Sloane, President, OEIS Foundation.
11 South Adelaide Avenue, Highland Park, NJ 08904, USA.
Also Visiting Scientist, Math. Dept., Rutgers University, Piscataway, NJ.
Phone: 732 828 6098; home page: http://NeilSloane.com
Email: njasloane at gmail.com



On Tue, Jun 23, 2015 at 5:59 AM,  <hv at crypt.org> wrote:
> I see that Robert Israel and T. D. Noe have also been working on this,
> but I've uploaded my results anyway; I'm not sure if that's a breach
> of etiquette, apologies if it is.
>
> The approach I used was to take advantage of perl's regular expression
> capabilities, coupled with the realisation that perl can optimize patterns
> anchored to the start far better than those anchored to the end - reversing
> the string to allow that gave a speedup of several orders of magnitude:
>
> my $string = "";
> digit('1', 0);
> for (2 .. $limit) {
>     my($repeat, $digit) = ($string =~ m{ ^ (.*) ([12]) \1 }x) or die;
>     digit($digit eq '1' ? '2' : '1', length($repeat) + 1);
> }
>
> sub digit {
>     my($digit, $repeat) = @_;
>     $string = $digit . $string;
>     # n A6345(n) A6346(n)
>     printf "%s %s %s\n", length($string), $digit, $repeat;
> }
>
> This takes about 45s to calculate 50,000 terms of both sequences.
>
> Hugo
>
> I wrote:
> :I have these calculated, just checking the results and I'll upload them.
> :
> :Hugo
> :
> :Neil Sloane <njasloane at gmail.com> wrote:
> ::Dear Seq Fans,
> ::Going through my old correspondence files
> ::(Kellen Myers is helping me scan in some of the crucial unpublished
> ::historical material, which we are adding to the appropriate
> ::entries), I came across the original letters from Nathaniel Hellerstein
> ::concerning A006345 and A006346 (scans of some
> ::of this will be added to the OEIS soon)
> ::
> ::In one letter from 1978 he sent me 20000 terms of those two sequences
> ::on computer printouts.  The present b-files
> ::only give 1000 terms.  It would be nice to show that we can
> ::do better.  Could someone produce 20000-terms b-files, or even
> ::50000-term b-files?
> ::
> ::Best regards
> ::Neil
> ::
> ::Neil J. A. Sloane, President, OEIS Foundation.
> ::11 South Adelaide Avenue, Highland Park, NJ 08904, USA.
> ::Also Visiting Scientist, Math. Dept., Rutgers University, Piscataway, NJ.
> ::Phone: 732 828 6098; home page: http://NeilSloane.com
> ::Email: njasloane at gmail.com
> ::
> ::_______________________________________________
> ::
> ::Seqfan Mailing list - http://list.seqfan.eu/
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/



More information about the SeqFan mailing list