{"id":18010180,"url":"https://github.com/p-e-w/sequencer","last_synced_at":"2025-10-05T07:31:36.606Z","repository":{"id":27410497,"uuid":"30887403","full_name":"p-e-w/sequencer","owner":"p-e-w","description":"Purely algorithmic number sequence identification","archived":false,"fork":false,"pushed_at":"2022-02-05T14:26:08.000Z","size":200,"stargazers_count":29,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T17:02:03.760Z","etag":null,"topics":["computer-algebra","formula","identify-sequences","mathematics","sequence"],"latest_commit_sha":null,"homepage":"http://sequenceboss.org","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p-e-w.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-16T20:44:36.000Z","updated_at":"2025-02-07T18:29:52.000Z","dependencies_parsed_at":"2022-09-02T19:02:16.998Z","dependency_job_id":null,"html_url":"https://github.com/p-e-w/sequencer","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/p-e-w/sequencer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-e-w%2Fsequencer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-e-w%2Fsequencer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-e-w%2Fsequencer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-e-w%2Fsequencer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p-e-w","download_url":"https://codeload.github.com/p-e-w/sequencer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-e-w%2Fsequencer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278425460,"owners_count":25984681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-algebra","formula","identify-sequences","mathematics","sequence"],"created_at":"2024-10-30T02:13:15.206Z","updated_at":"2025-10-05T07:31:36.358Z","avatar_url":"https://github.com/p-e-w.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# *Sequencer* – purely algorithmic number sequence identification\n\nSequencer identifies number sequences. That is, given a list of numbers like\n\n```\n(a(n)) = 1, 2, 4, 8, 16, 32, ...\n```\n\nit finds a formula that generates them, in this case\n\n```\na(n) = 2^(n-1)\n```\n\nSequencer employs neither a library of sequences nor a limited set of algorithms to find a closed form. Instead, it generates **all** formulas up to a certain size and then checks them against the provided numbers.\n\nFor verification, the system uses a hybrid approach of a fast numerical checker followed by a symbolic verifier powered by the [Symja](https://bitbucket.org/axelclk/symja_android_library/wiki/Home) computer algebra system. Coupled with some tricks and heuristics designed to quickly generate potentially interesting formulas, Sequencer can identify sequences with very complex closed forms in a matter of seconds when run on commodity hardware.\n\nSequencer is capable of finding closed forms that are beyond any existing system like [OEIS](http://oeis.org/), [Superseeker](http://oeis.org/ol.html) and [Wolfram Alpha](http://www.wolframalpha.com/). It is particularly strong where recurrence relations or unusual combinations of functions are involved. For example, none of the services mentioned above can currently make sense of the sequence\n\n```\n(a(n)) = 1, 1, 1, 3, 5, 15, 43, 273, ...\n```\n\nwhile Sequencer reveals that it satisfies the recurrence relation\n\n```\na(1) = 1\na(2) = 1\na(3) = 1\na(n) = a(n-2)^2+a(n-1)+a(n-3)   for n \u003e= 4\n```\n\nand provides the continuation\n\n```\n2137, 76709, 4643751, 5888916569, 21570312343279, ...\n```\n\n### Symbolic input and output\n\nSequencer is not limited to processing integers but can identify sequences consisting of arbitrary Symja expressions (provided they can be evaluated numerically). For example, invoking the program with the arguments `0 1/2 sqrt(3)/2 1` produces\n\n```\na(n) = Sin(1/6*Pi*(n-1))\nContinuation: 1/2*3^(1/2), 1/2, 0, -1/2, (-1/2)*3^(1/2), ...\n```\n\nNote that parentheses in arguments need to be escaped (`\\(`) when running a program from a shell like bash.\n\n## Installation and usage\n\nSequencer requires [Java](https://www.java.com) to run. Download the latest standalone Sequencer JAR (`sequencer.jar`) from the [releases page](https://github.com/p-e-w/sequencer/releases) and execute it from a terminal with the numbers to be matched as arguments, i.e.\n\n```\njava -jar sequencer.jar 1 2 3 4 5\n```\n\nRunning the program without arguments displays a help text explaining the various command line parameters that can be used to fine-tune how searches are performed.\n\n## API\n\nSequencer can also be used as a library, for which precompiled JARs (`sequencer-library-X.X.X.jar`) are available on the [releases page](https://github.com/p-e-w/sequencer/releases).\n\nThe class `Sequencer` provides the method\n\n```scala\ndef identifySequence(sequence: Seq[String]): Seq[SequenceIdentification]\n```\n\nthat returns objects of type\n\n```scala\ncase class SequenceIdentification(formula: String, continuation: Seq[String])\n```\n\nWhen instantiating, the class must be passed a `Configuration` object\n\n```scala\ncase class Configuration(\n\tmaximumComplexity: Int,\n\tmaximumIdentifications: Int,\n\tpredictionLength: Int,\n\trecurrenceDepth: Int,\n\tcombinatorialFunctions: Boolean,\n\tnumberTheoreticFunctions: Boolean,\n\ttranscendentalFunctions: Boolean,\n\tparallelSearch: Boolean,\n\tnumericalTest: Boolean,\n\tprintProgress: Boolean,\n\toutputLaTeX: Boolean\n)\n```\n\nthat controls the behavior of `identifySequence`. For more details, see the source code.\n\n## Development\n\nSequencer is written in Scala. To compile Sequencer from source, you need [Git](http://www.git-scm.com/), a [JDK](http://www.oracle.com/technetwork/java/index.html), the [Scala compiler](http://www.scala-lang.org/), and [sbt](http://www.scala-sbt.org/). Once all of these are installed and on your `PATH`, you are ready to build and run Sequencer:\n\n```\ngit clone https://github.com/p-e-w/sequencer.git\ncd sequencer\nsbt run\n```\n\nThe standalone JAR can be created using\n\n```\nsbt assembly\n```\n\nThe library JAR can be created using\n\n```\nsbt package\n```\n\nAll generated JARs will be written to `target/scala-X.XX/`.\n\nTo develop Sequencer using a Scala IDE, have sbt generate project files with a plugin like [sbteclipse](https://github.com/typesafehub/sbteclipse) or [sbt-idea](https://github.com/mpeltonen/sbt-idea).\n\n## Credits\n\nBesides its runtime and compilation environment (Java, Scala and sbt), Sequencer depends on the [Symja](https://bitbucket.org/axelclk/symja_android_library/wiki/Home) computer algebra system and the [scopt](https://github.com/scopt/scopt) command line parser. The standalone release JARs are built using the excellent [sbt-assembly](https://github.com/sbt/sbt-assembly) plugin.\n\n## License\n\nCopyright © 2015 Philipp Emanuel Weidmann (\u003cpew@worldwidemann.com\u003e)\n\nReleased under the terms of the [GNU General Public License, Version 3](https://gnu.org/licenses/gpl.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp-e-w%2Fsequencer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp-e-w%2Fsequencer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp-e-w%2Fsequencer/lists"}