.TH "SLOANE" "1" "18 Aug 2015" "User Manual" "Version 4.0.0" .SH NAME .PP sloane: A command line interface to Sloane\[aq]s OEIS. .SH SYNOPSIS .PP \f[B]sloane\f[] \f[C]OPTIONS\ \-\-oeis\ TERMS...\f[] .PD 0 .P .PD \f[B]sloane\f[] \f[C]OPTIONS\ (\-q|\-\-query)\ A\-NUMBER/SEQUENCE...\f[] .PD 0 .P .PD \f[B]sloane\f[] \f[C][\-\-invert]\ \-\-filter\f[] .SH DESCRIPTION .PP The \f[C]sloane\f[] command provides an interface to OEIS (The On\-Line Encyclopedia of Integer Sequences). It can be used online with the \f[C]\-\-oeis\f[] operation, and offline with the \f[C]\-\-query\f[] operation; offline mode is the default. .SH OPERATION \-\-oeis .SS Synopsis .PP \f[C]sloane\ [\-\-long]\ [\-k\ KEYS]\ [\-n\ N]\ [\-\-all]\ [\-\-monochrome]\ [\-\-json]\ \-\-oeis\ TERMS...\f[] .SS Description .PP Lookup search terms in Sloane\[aq]s On\-Line Encyclopedia of Integer Sequences (OEIS). .SS Options .TP .B \-\-long Long format; print all fields. .RS .RE .TP .B \-k \f[I]KEYS\f[] Keys of fields to print (default: SN). .RS .RE .TP .B \-n \f[I]N\f[] Fetch at most this many entries (default: 5). .RS .RE .TP .B \-\-all Fetch all matching entries (equivalent to \-n 999999). .RS .RE .TP .B \-\-monochrome Do not colorize the output. Useful when piping the output to another program. .RS .RE .TP .B \-\-json Output results is JSON format. .RS .RE .SS Examples .PP The most common search is for entries matching a sequence of consecutive terms: .IP .nf \f[C] sloane\ \-\-oeis\ 1,3,19,183,2371,38703 \f[] .fi .PP At the time of writing this particular query would return .IP .nf \f[C] S\ A006531\ 1,1,3,19,183,2371,38703,763099,17648823,468603091,14050842303, N\ A006531\ Semiorders\ on\ n\ elements. \f[] .fi .PP As this illustrates, the default is to return just the sequence (S) and the name (N) fields. To override the default one can use the keys option. For instance, the following search shows the sequence, name, comments, and formula fields of the sequence whose A\-number is A006531: .IP .nf \f[C] sloane\ \-k\ SNCF\ \-\-oeis\ id:A006531 \f[] .fi .PP The next example returns at most 3 results of a free text search: .IP .nf \f[C] sloane\ \-n\ 3\ \-\-oeis\ "(2+2)\-free\ posets" \f[] .fi .PP Sloane normally crops long lines to fit the widths of the terminal. If this is unwanted, pipe the output through cat or less: .IP .nf \f[C] sloane\ \-\-long\ \-\-oeis\ id:A000110\ |\ less\ \-R \f[] .fi .SH OPERATION \-\-query .SS Synopsis .PP \f[C]sloane\ [\-\-long]\ [\-k\ KEYS]\ [\-n\ N]\ [\-\-all]\ [\-\-monochrome]\ [\-\-json]\ (\-q|\-\-query)\ A\-NUMBER/SEQUENCE...\f[] .SS Description .PP Search locally against a downloaded local database of known sequences. This type of query is less flexible, but faster, than using the \f[C]\-\-oeis\f[] operation: With \f[C]\-\-query\f[] one can only lookup A\-numbers and seqences; free text searches are not supported. Also, the fields returned by \f[C]\-\-query\f[] are \[aq]S\[aq] and \[aq]N\[aq]. .SS Examples .PP Lookup A\-numbers: .IP .nf \f[C] $\ sloane\ \-\-query\ A000111\ A000112 S\ A000111\ 1,1,1,2,5,16,61,272,1385,7936,50521,353792,2702765, N\ A000111\ Euler\ or\ up/down\ numbers:\ e.g.f.\ sec(x)\ +\ tan(x).. S\ A000112\ 1,1,2,5,16,63,318,2045,16999,183231,2567284,46749427, N\ A000112\ Number\ of\ partially\ ordered\ sets\ ("posets")\ with\ n.. \f[] .fi .PP Lookup a sequence: .IP .nf \f[C] $\ sloane\ \-n2\ \-q\ 1,1,2,5,15,52,203,877,4140,21147,115975,678570, S\ A000110\ 1,1,2,5,15,52,203,877,4140,21147,115975,678570,4213597, N\ A000110\ Bell\ or\ exponential\ numbers:\ number\ of\ ways\ to\ partition.. S\ A192128\ 1,1,2,5,15,52,203,877,4140,21147,115975,678570,4213597, N\ A192128\ Number\ of\ set\ partitions\ of\ {1,\ ...,\ n}\ that\ avoid.. \f[] .fi .SS Options .PP Same as for the \f[C]\-\-oeis\f[] operation. .SH OPERATION \-\-filter .SS Synopsis .PP \f[C]sloane\ [\-\-invert]\ \-\-filter\f[] .SS Description .PP To check a large number of sequences one can use \f[C]\-\-filter\f[]. When this option is set, \f[C]sloane\f[] reads the standard input line\-by\-line, if the sequence read is in the local database, then it is returned to the standard output; if not, it is ignored. This way one can quickly filter out the sequences from the input that are in the local database. In other words, assuming that \f[I]FILE\f[] contains one sequence per line, .IP .nf \f[C] sloane\ \-\-filter\ . .IP .nf \f[C] I\ \ ID\ number S\ \ 1st\ line\ of\ unsigned\ sequence T\ \ 2nd\ line\ of\ unsigned\ sequence U\ \ 3rd\ line\ of\ unsigned\ sequence V\ \ 1st\ line\ of\ signed\ sequence W\ \ 2nd\ line\ of\ signed\ sequence X\ \ 3rd\ line\ of\ signed\ sequence N\ \ Name C\ \ Comments D\ \ References H\ \ Links F\ \ Formula e\ \ Examples p\ \ Maple\ program t\ \ Mathematica\ program o\ \ Program\ in\ other\ language Y\ \ Cross\-references K\ \ Keywords O\ \ Offset A\ \ Author E\ \ Extensions\ and\ errors \f[] .fi .SH NOTES .PP Please use the \f[C]\-\-oeis\f[] option with moderation as not to overburden the OEIS\-server; see OEIS\[aq] policy on searching the database: . .SH SEE ALSO .PP .SH AUTHOR .PP Anders Claesson