This site is supported by donations to The OEIS Foundation.

User:M. F. Hasler/Work in progress/Improvements of OEIS/keyword lrec

From OeisWiki
Jump to: navigation, search

(Edit this Sect.0) This is about the introduction of new keyword "lrec" with an arbitrary number of optional arguments, providing several

  • easy to implement (cf. Implementation),
  • quite powerful enhancements, for linear recurrent sequences.

Synopsis

lrec:c1:...:cN

where the optional arguments c1,...,cN are N numerical parameters(**). This describes a linear recurrent sequence with coefficients c1,...,cN, i.e., a(n) = sum( c_i a(n-i), i=1..N ).

(**) A possible extension could allow other additional arguments, not necessarily numerical. For example, lrec:order:99 could describe a lin.rec. sequence of order 99 but unspecified coefficients. (Here, "order" would be an invariable textual qualifier, and "99" an arbitrary numerical positive integer argument.)

Aims and scope

This KW would allow

  • identification of N-th order lin.rec. sequences (a special convention, e.g. lrec:N:0 or lrec:order:N could be used to specify the order without giving the coefficients (maybe useful in special cases, e.g. very large N)
  • classification (in the classical index, or a automatically built special index for LREC sequences)
  • (as main purpose) "on the fly" computation of an arbitrary number of terms, assuming that the "regular part" of the recurrence has started sufficiently early such that this can be done based on the N last terms given as DATA.
  • output of these terms
    • in several forms, mainly as b-file, but maybe also as table, graph, list, ...;
    • all of these in various file formats (TXT, CSV, XLS, RTF, TEX, GIF, SVG, PNG, ...) and data formats
      (a "printf" type format specifier fmt would be possible)

Details

Dynamic b-file creation

It's extremely easy to implement "on the fly" computation of an arbitrary number of terms, assuming that the "regular part" of the recurrence has started sufficiently early such that this can be done based on the N last terms given as DATA.

Several options are there:

  • To decide how many terms
    • a dedicated page with a form
    • a popup window when clicking on the kw
    • fixed buttons/links to produce a b-file of 100, 1000,... terms
  • Different formats could be available:
    • with or w/o a descriptive header line
    • lines of the table in format "%d %l" or "%l" or "[%d, %l]" or "%d \t %l" or "%d, %l" or "%d & %l \\", ... (where %d represents the index n and %l the data a(n)).
    • in TXT or XLS or CSV or RTF or other formats

Further improvements

Heuristics for default upper limits for the range

Examining the DATA (growth and/or size of the last/largest terms given in DATA), heuristics can be given to determine what size(s) (upper limits) would be reasonable for the b-file:

(to be written)


Dynamic graph creation

Based on the possibility of very easily computing an arbitrary number of terms,

  • not only b-files but also graphics (scatterplot, ....) could be created
  • in GIF or SVG or PNG or any other format.

For some common requests (seq.no., ranges, formats...), the results could be cached on the server. This also applies to what precedes; and what precedes (heuristics,...) also applies to this here.


Automatic indexing

Link to index section

  • This kw, with or without optional args, allows to build a link to the appropriate section of the OEIS index

....

Building an index of lrec sequences

  • Going far beyond the above "elementary" functionality, and requiring much more work, the lrec kw could also be used to automatically build an index of all (so labelled) lin.rec. sequences.
Thanks! That may be useful, but in my view "the other way round": I'll elaborate on the talk page. — M. F. Hasler 13:56, 31 December 2013 (UTC)

Code snippets

[This section is still to be written. You can help! :)] (Should this section be duplicated and moved to the respective feature's discussion? - I think not.)