Hello there,
> I just noticed a small inconvenience with Richard's conventions.
> When you enter (say) A000290 := n -> n^2; then A000290 becomes
> a link in the database, which makes no sense at this place.
I think the hyperlinking of Axxxxx in the PROG sections is not a
problem,
usually a copy-paste will work well anyway, and in case the function
uses other Ayyyyyy functions this is handy to go there.
Sometimes I want to give a short Axxxxx function which returns the
n'th element,
but also provide an easy possibility to show the list
a(offset)...a(n),
especially when computation of the n-th element implies computation
of
all previous elements (e.g. for calculation of the n-th composite
number).
Sometimes I provide a function where a 2nd optional are allows to
display and/or return these previous elements.
e.g.
Axxx(n, print_all=0)={ ... }
Then Axxx(n) would yield the n-th element, and Axxx(n,1) would in
addition to this result print all preceding elements.
Other varaiations are possible, like
Axxx(n, return_all=0)={ ... } where Axxx(n,1) would return
[a(offset),...,a(n)]
sometimes it is useful to have Axxx(n, verbose=0)={ ... }
where setting verbose to something nonsero would print out information
about the search process, or so.
It is nice to have some "standards" (in principle I agree on Axxx,
Axxx_list, isAxxx),
but often for a given sequence not all possibilities are
"relevant" (especially w.r.t. computational efficiency).
The decision of what to implement among Axxx(n), Axxx_list(),
isAxxx(),... depends IMO often on the nature of the sequence.
(e.g. if computation of T(n,k) is immediate, the Axxx_row, Axxx_col
etc. can be implemented using the elementary definition,
but if it is natural and/or much easier to compute the whole row and/
or column at once, then these functions may make sense.
> I also noticed some functions of Reinhard Zumkeller who wrote
> a000290 in a similar case which avoids this. Maybe I will
> switch to this convention.
in a (very) few cases I use both, A... and a... for distinct things,
usually the former is the function, and the latter is e.g. a (global)
memoization table,
or the list of values (of another sequence, used to calculate Axxx).
This is also needed if one wants co-existence of the function and of a
list of precomputed values
(which in principle should have te same name, since Axxx(n) and
Axxx[n] should be the same)
- of course AxxxL for the list would be a possible (less or more
elegant?) alternative.
Maximilian
On Nov 26, 1:37 pm, Peter Luschny <
peter.lusc...@googlemail.com>
wrote: