Access sequences from the On-Line Encyclopedia of Integer Sequences (OEIS) directly from R
OEIS is one of the world's most valuable mathematical resources: thousands of integer sequences with formulas, comments, references, and code. It has contributed to mathematical discoveries and is cited in over 6000 articles. OEIS.R brings this data to R in a structured way, making it easy to visualize, analyze, and use in mathematical hypotheses or contributions to OEIS.
# install.packages("devtools") # if you don't have it
devtools::install_github("EnriquePH/OEIS.R")Rlibrary(OEIS.R)
library(ggplot2)
# Download the Fibonacci sequence (A000045)
fib <- OEIS_sequence("A000045")
# Basic info
OEIS_description(fib)
OEIS_formula(fib)
# Quick plot (add your own image here after generating it!)
OEIS_plot(fib)id <- "A001615"
x <- OEIS_sequence(id)
OEIS_ggplot(x) +
geom_line() +
geom_point(size = 0.5, color = "green") +
labs(title = paste("OEIS", id, "-", OEIS_name(x)))Download and parsing of OEIS sequences (terms, description, formula, offset, etc.). Seamless integration with ggplot2 for visualization. Helper functions:
- OEIS_description()
- OEIS_formula()
- OEIS_keywords()
Respects OEIS terms of use (rate limiting recommended). Example Shiny app for interactive exploration.
Try the interactive demo: OEIS.R Shiny App
Contributions are welcome! Feel free to open issues or pull requests for features like term-based search, caching, extended parsing, or vignettes.
Enrique Pérez Herrero
- GitHub: @EnriquePH
- LinkedIn: eph3000
Built with RStudio • Licensed under the MIT License

