As a purely intellectual challenge, provided that you recognise that any solution will be severally restricted in the sequences it will recognise, and will inevitably mis-categorise some high 90s percentage of the possiblities, then it is vaguely interesting.

As an expenditure of Perl6 development time, it is a complete waste.

This is because it would take an immense amount of effort (and code) to do anything more than a 'piss poor job'. And even if that effort was expended and the code incorporated, and it was possible for the computer to intuit the sequence behind (say):

my @sequence = 1, 18, 4, 13 .. *;

The human being (that mythical maintanence programmer), will unlikely be able to do the same!

And almost everyone is going to code that as:

my @sequence = 1, 18, 4, 13 .. *; ## dartboard

Which means it would be far simpler and far better to avoid the "magical" and just incorporate (or have a module that supplies), a few pre-defined sequences like:

my @odds = ODDS; ## or LAZY_ODDS or LAZY_ODDS_FROM( 11 ) my @evens = EVENS; my @board = DARTBOARD;

A simple module that supplies a bunch of these 'well named sequences' would be easy to code and infinitely extensible and keep the need for potentially buggy and always limited 'magical' code out of the core.

Building, testing and verifying a module that contained/exported the entire OEIS database manually would probably take far less time, than trying to write code to divine 1% of them. And it probably would not take a great deal of effort to write code to query the OEIS database directly, and generate the module automatically.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re: Challenge: Simple algorithm for continuing series of integers by BrowserUk
in thread Challenge: Simple algorithm for continuing series of integers by moritz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.