https://github.com/jtpeller/oeis
Algorithms for various integer sequences from the OEIS site.
https://github.com/jtpeller/oeis
go golang integer-sequences math oeis
Last synced: 7 months ago
JSON representation
Algorithms for various integer sequences from the OEIS site.
- Host: GitHub
- URL: https://github.com/jtpeller/oeis
- Owner: jtpeller
- License: gpl-3.0
- Created: 2021-12-07T02:17:47.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T01:58:22.000Z (10 months ago)
- Last Synced: 2025-06-02T08:35:35.577Z (8 months ago)
- Topics: go, golang, integer-sequences, math, oeis
- Language: Go
- Homepage:
- Size: 287 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OEIS
[](https://goreportcard.com/report/github.com/jtpeller/oeis)
[](https://github.com/jtpeller/oeis/releases)
[](https://github.com/jtpeller/oeis/blob/main/LICENSE)
## Overview
The ongoing quest to program every sequence in the OEIS database (in Golang)
## Content
- `sequences` -- The folder containing the seq package, which contains all programmed sequences
- `utils` -- Contains any and all utility functions that are very common (say, a PrintSequence function). Also includes any common calculations or generator functions for common sequences (such as primes or the factors of a number).
- `go.mod` -- Handles the OEIS module
- `main.go` -- The file containing main
- `README.md` -- The file you're reading right now
## Notes
Each of the sequence functions (those functions starting with `A...`) will return:
- The integer sequence that is produced. Type: `[]int64 || *big.Int`
- The offset (aka starting position or starting index). Type: `int64`
My strategy is not completing 100% of every sequence in order, but rather program as many of the OEIS sequences as possible. There's ~350 *thousand* sequences so my goal is to just get as many programmed as possible.
## Usage
Run the program with `go run main.go` and some options. For example:
```sh
go run main.go -seq A000045 -seqlen 50 -time
```
Use `go run main.go -h` or `go run main.go --help` for more information.
Options:
- `-seq` -- Give the sequence ID (A000002 for example)
- `-seqlen` -- Give the number of elements to generate. There may be limits on some of the sequences due to overflow or warnings due to rounding inaccuracies or lengthy computations.