Request for more Python programs
Jaap Spies
j.spies at hccnet.nl
Tue Jan 2 00:32:21 CET 2007
N. J. A. Sloane wrote:
> Dear Seqfans, There are very few Python programs in the OEIS.
> I would like to get more - even for the simplest sequences,
> and especially for all the important sequences, whenever appropriate.
>
> I would prefer readable programs (rather than the opaque one-line
> Mma programs that the OEIS is full of). For one thing, that
> will enable people to learn Python.
>
And or SAGE! As SAGE _is_ Python in a way, all Python programs run in SAGE.
So :g/Python/s//SAGE/g
Agreed Python/SAGE is far more readable compared to Mathematica (don't flame!).
As I wrote before about SAGE, we are in the proces of making available the OEIS
within SAGE. The database of sequences is already there, but in
sage-1.6 or sage-2.0 there will be a growing number of functions
to produce sequences:
A111776(n) will give the n-th number and
A111776_list(n) wil give the list of the first n numbers of ...
So in the long run we may see a line
%o A111776 (SAGE) sloane.A111776(n)
See http://www.research.att.com/~njas/sequences/A111776
A few more examples: http://www.jaapspies.nl/oeis/
> Since leading spaces and newlines have a special meaning in Python,
> we are using the style illustrated below:
>
As an alternative: place a link to an external location. This is certainly
more attractive for larger programs.
Best wishes,
Jaap
More information about the SeqFan
mailing list