[seqfan] Re: metadata for Mathematica code

Frank Adams-Watters franktaw at netscape.net
Tue Nov 3 02:03:26 CET 2015


I and some others prefer to represent this information in the function name. My personal preference is:

a(n) - the value of the sequence at index n.
alist(n) - a list of the first n values of the sequence.
alim(n) - a list of the value of the sequence that are <= n.
isa(n) - true if n is in the sequence.

I prefer "alist", "alim", and "isa" to just "list", "lim", and "is", because you can then just replace the "a" with the sequence number when you want to reference a program from another sequence. So in A000040 (the primes) you might have an isa(n) function which returns whether n is a prime. In some other sequence, you might then refer to isA000040(n) for whether n is prime. (This is just a example; any decent mathematical programming environment is going to have an "isprime" function (by that name or some other). More names, such as "arow" and "acol", are needed for tables.

I like this better than adding additional text, because it produces less clutter.

(There are also programs which just return the sequence to a prespecified point, without necessarily defining any functions - though usually a function is defined and then executed. I would like to see these phased out.)

What I might like to see as metadata is some indication of the purpose of the program. Is this to illustrate the definition of the sequence or some formula for it? Or is it intended to be an efficient way to compute the sequence? (If a program serves neither of these purposes, I see no reason it should be in the database.)

Franklin T. Adams-Watters


-----Original Message-----
From: Eric Rowland <rowland at lacim.ca>

Hi all,

Wolfram Research has a mentorship student, JungHwan Min, who is going
to be
contributing Mathematica / Wolfram Language code to OEIS entries.  I
think
this is a great opportunity to start adding metadata identifying what
each
program does (computes the nth term vs. computes the first n terms,
etc.).
Having more structured data in the OEIS will make it that much more
useful,
especially for programmatic tasks.  You can imagine eventually being
able
to query for a list of all functions that define the nth term of
a
2-automatic sequence, for example.

Charles Greathouse and I discussed this at
length about a year ago and came
up with an initial list of labels.  It makes
sense to put labels in
comments, so for example the Mathematica field for
A000108 would look like
this:

(* TermFunction *)
snipped from here



More information about the SeqFan mailing list