The Wayback Machine - https://web.archive.org/web/20240620042647/https://www.geeksforgeeks.org/how-to-use-oesis/
Open In App

How to use OESIS (On-line Encyclopedia of Integer Sequences)

Last Updated : 10 Feb, 2018
Improve
Improve
Like Article
Like
Save
Share
Report

We sometimes land up in a situation when various coding problems can be simplified to a mathematical formula but often finding that formula isn’t that straightforward .Here comes, OESIS for rescue. We can calculate the terms for initial indices i.e n=0,1,2,3,…….. and then may use OEIS to find the mathematical expression.

This article focuses on using OEIS (On-line Encyclopedia of Integer Sequences) to solve many complex problems easily by formulating them in some sort of mathematical expression. OEIS is a massive encyclopedia where we can look for various sequences and find their mathematical expression,examples and related facts about them .

Lets try to understand using an example: You are given n balls and are supposed to make equilateral triangle as shown in the image below.Each subsequent pattern should add a new row  to the triangle.

OESIS_GeeksforGeeks

Now if we see the sequence of dots being added to form triangle,

The first few numbers are 1, 3, 6, 10, 15…

This problem is known as  triangular number which counts the objects that can form an equilateral triangle,. The nth triangular number is the number of dots composing a triangle with n dots on a side, and is equal to the sum of the n natural numbers from 1 to n. The sequence of triangular numbers starting at the 0th triangular number, is:

0, 1, 3, 6, 10, 15 ….

Now we have got the sequence and if we search it on OEIS ,we get the following result:

o
OESIS proves extremely helpful in finding the algorithm to solve the problem.OEIS records information on integer sequences of interest to both professional mathematicians and amateurs, and is widely cited. As of 22 August 2015 it contains over 260,000 sequences, making it the largest database of its kind.


Similar Reads

Count sequences of positive integers having product X
Given an array arr[] of size N, the task is to find the total number of sequences of positive integers possible (greater than 1) whose product is exactly X. The value of X is calculated as the product of the terms where ith term is generated by raising ith prime number to the power of arr[i]. X = 2 ^ arr[1] * 3 ^ arr[2] * 5 ^ arr[3] * 7 ^ arr[4] *
9 min read
Swift - Integer, Floating-Point Numbers
Integers are whole numbers that can be negative, zero, or positive and cannot have a fractional component. In programming, zero and positive integers are termed as “unsigned”, and the negative ones are “signed”. Swift provides these two categories in the form of 8-bit, 16-bit, 32-bit and 64-bit format. The integers in Swift follow a naming conventi
2 min read
How to Download YouTube Videos in Linux Command Line?
The videos can be downloaded from the online source through the Linux terminal using the youtube-dl tool. youtube-dl is a Python-based small command-line tool that makes it possible to download the videos from Youtube, Facebook, Dailymotion, and few more similar sites. It is written in PyGTK and requires Python interpreter to run this program, it’s
2 min read
Top Linux Command Line Tips and Tricks
Linux is a great OS that offers multiple options for simplifying tasks. It has everything you need for working more efficiently, whether a command-line or a GUI. However, many people don't know the Linux command line's short tricks and end up being stuck in complex tasks. An interface (text-based) through which you communicate with your system's OS
5 min read
SQL vs NoSQL: Which one is better to use?
To be, or not to be: that is the question! Shakespeare was probably not thinking about databases when he wrote this line but this is still the critical question most companies face these days. The biggest decision when it comes to choosing a database is picking a relational database (SQL) or a non-relational (NoSQL) database. While a relational dat
7 min read
10 Best ChatGPT Plugins You Should Use
ChatGPT is a Natural Language Processing tool released by OpenAI in 2023. Almost like a human, this tool can interact with the person by its ability to answer follow-up questions, admit mistakes, correct responses challenge incorrect premises, reject inappropriate requests, and much more. With these abilities, ChatGPT has become a very powerful and
9 min read
How Does Google Use Machine Learning?
In modern times, Google is everywhere!!! So much so that you are most probably reading this article using Google Search. And while Machine Learning has long been a part of Google, now it seems that ML is everywhere! From Google Search to Google Photos to even Google Translate, everything uses Machine Learning. And these are only the more common ite
5 min read
Blockchain as a Service Platform - Easy to use
With the growth of the crypto market, the demand for blockchain has increased and people are seeking various possibilities of growth and taking interest in blockchain as a service platform. There are so many applications of blockchain which are the best things of blockchain as a tool platform for business. Its applications are making the scope of B
6 min read
How to use Emojis in Windows 10?
Nowadays Emojis are part of our day to day life. We use emojis, like smiles to express our feelings, and it is very popular in electronic messages and web pages. Typing emojis on Windows 10 was somehow difficult until the new Windows 10 Fall Creators Update. To use emojis you have to Enable the "Show Touch Keyboard Button" by right-clicking on the
1 min read
I Can't Use Logic In Programming. What Should I Do?
Are you a new developer and recently stepped into programming? You might be getting frustrated when you see that you don't get logic in programming and you don't know how to start solving a specific problem. You see other developers are good at using their brains in programming and solving the coding question very quickly. It also happens that when
10 min read
Article Tags :