Nearby Words

Online Encyclopedia of Integer Sequences

On-Line Encyclopedia of Integer Sequences

The On-Line Encyclopedia of Integer Sequences (OEIS), also cited simply as Sloane's, is an extensive searchable database of integer sequences, freely available on the Web.

OEIS records information on integer sequences of interest to both professional mathematicians and amateurs, and is widely cited. It contains over 140,000 sequences, making it the largest database of its kind.



Neil Sloane started collecting integer sequences as a student in the mid-1960's to support his work in combinatorics. The database was at first stored on punch cards. He published selections from the database in book form twice:

  1. A Handbook of Integer Sequences (1973, ISBN 0-12-648550-X), containing 2,400 sequences.
  2. The Encyclopedia of Integer Sequences with Simon Plouffe (1995, ISBN 0-12-558630-2), containing 5,487 sequences.

These books were well received and, especially after the second publication, mathematicians supplied Sloane with a steady flow of new sequences. The collection became unmanageable in book form, and when the database had reached 16,000 entries Sloane decided to go online—first as an e-mail service (August 1994), and soon after as a web site (1995). The database continues to grow at a rate of some 10,000 entries a year.



In 2004, Sloane celebrated the addition of the 100,000th sequence to the database, . In 2006, the user interface was overhauled and more advanced search capabilities were added.



Sequences of rationals are represented by two sequences (named with the keyword 'frac'): the sequence of numerators and the sequence of denominators. For example, the fifth order Farey sequence, {1 over 5}, {1 over 4}, {1 over 3}, {2 over 5}, {1 over 2}, {3 over 5}, {2 over 3}, {3 over 4}, {4 over 5}, is catalogued as the numerator sequence 1, 1, 1, 2, 1, 3, 2, 3, 4 and the denominator sequence 5, 4, 3, 5, 2, 5, 3, 4, 5 ().

Important irrational numbers such as π = 3.1415926535897... are catalogued under representative integer sequences such as decimal expansions (here 3, 1, 4, 1, 5, 9, 2, 6, ... ()) or continued fraction expansions (here 3, 7, 15, 1, 292, 1, ... ()).


The OEIS is currently limited to plain ASCII text, so it uses a linear form of conventional mathematical notation (such as f(n) for functions, n for running variables, etc.). Greek letters are usually represented by their full names, e.g., mu for μ, phi for φ.

Every sequence is identified by the letter A followed by six digits, sometimes referred to without the leading zeros, e.g., A315 rather than A000315.



Special meaning of zero


This special usage has a solid mathematical basis in certain counting functions. For example, the totient valence function N_phi(m) counts the solutions of φ(x) = m. There are 4 solutions for 4, but no solutions for 14, hence a(14) of A014197 is 0—there are no solutions.

Occasionally -1 is used for this purpose instead, as in .

Lexicographic ordering

The OEIS maintains the lexicographic order of the sequences, so each sequence has a predecessor and a successor (its "context"). OEIS normalizes the sequences for lexicographic ordering, (usually) ignoring initial zeros or ones and also the sign of each element. Sequences of weight distribution codes often omit periodically recurring zeros.

For example, consider: the prime numbers, the palindromic primes, the Fibonacci sequence, the lazy caterer's sequence, and the coefficients in the series expansion of {zeta(n + 2)} over {zeta(n)}. In OEIS lexicographic order, they are:





Sequence #5: 1, −3, −8, −3, −24, 24, −48, −3, −8, 72, −120, 24, −168, 144, ...



Very early in the history of the OEIS, many people suggested sequences derived from the placement of sequences in the OEIS itself. "I resisted adding these sequences for a long time, partly out of a desire to maintain the dignity of the database, and partly because A22 was only known to 11 terms!" Sloane reminisced.

One of the earliest self-referential sequences Sloane accepted into the OEIS was (later ) "a(n) = n-th term of sequence A_n." This sequence spurred progress on finding more terms of . For larger n that correspond to sequences that are finite and given in full (keywords "fini" and "full"), term a(n) of A091967 is undefined. lists the first term given in sequence An, but it needs to be updated from time to time because of changing opinions on offsets. Listing instead term a(1) of sequence An might seem a good alternative if it weren't for the fact that some sequences have offsets of 2 and greater.

This line of thought leads to the question "Is n in sequence An?" and the delightfully paradoxical sequences , n is in An, and , n is not in An. Thus, the composite number 2808 is in A053873 because is the sequence of composite numbers, while the non-prime 40 is in A053169 because it's not in A000040, the prime numbers. The paradox is, which sequences do 53169 and 53873 belong to? (This is a form of Russell's paradox.)

An abridged example of a typical OEIS entry

This entry, , was chosen because, with the exception of a Maple program, it contains every field an OEIS entry can have.

ID Number: A046970
Sequence:  1,3,8,3,24,24,48,3,8,72,120,24,168,144,192,3,288,24,360,72,
Signed: 1,-3,-8,-3,-24,24,-48,-3,-8,72,-120,24,-168,144,192,-3,-288,
Name: Generated from Riemann Zeta function: coefficients in series
             expansion of Zeta(n+2)/Zeta(n).
Comments: ... Apart from signs also Sum_{d|n} core(d)^2*mu(n/d) where core(x) is
             the squarefree part of x. - Benoit Cloitre
             (abcloitre(AT), May 31 2002
References M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions,
             Dover Publications, 1965, pp. 805-811.
Links: Wikipedia, Riemann zeta function. Formula: Multiplicative with a(p^e) = 1-p^2. a(n) = Sum_{d|n} mu(d)*d^2. Example: a(3) = -8 because the divisors of 3 are {1, 3}, and mu(1)*1^2 + mu(3)*3^2 =
a(4) = -3 because the divisors of 4 are {1, 2, 4}, and mu(1)*1^2 +
             mu(2)*2^2 + mu(4)*4^2 = -3
Math'ca: muDD[d_] := MoebiusMu[d]*d^2; Table[Plus @@ muDD[Divisors[n]], {n, 60}] (Lopez) Program: (PARI) A046970(n)=sumdiv(n,d,d^2*moebius(d)) (Benoit Cloitre) See also: Sequence in context: A016623 A046543 A035292 this_sequence A058936
             A002017 A086179
          Adjacent sequences: A046967 A046968 A046969 this_sequence A046971
             A046972 A046973
          Cf. A027641 and A027642.
Keywords: sign,mult Offset: 1 Author(s): Douglas Stoll, dougstoll(AT) Extension: Corrected and extended by Vladeta Jovovic (vladeta(AT)Eunet.yu),
             Jul 25 2001

Entry fields

ID number


A059097 Numbers n such that the binomial coefficient C(2n,n) is not divisible by the square of an odd prime. January 1, 2001
A060001 Fibonacci(n)!. March 14, 2001
A066288 Number of 3-dimensional polyominoes (or polycubes) with n cells and symmetry group of order exactly 24. January 1, 2002
A075000 Smallest number such that n*a(n) is a concatenation of n consecutive integers ... August 31, 2002
A078470 Continued fraction for Zeta(3/2) January 1, 2003
A080000 Number of permutations satisfying -k<=p(i)-i<=r and p(i)-i February 10, 2003
A090000 Length of longest contiguous block of 1's in binary expansion of n-th prime. November 20, 2003
A091345 Exponential convolution of A069321(n) with itself, where we set A069321(0)=0. January 1, 2004
A100000 Marks from the 22000-year-old Ishango bone from the Congo. November 7, 2004
A102231 Column 1 of triangle A102230, and equals the convolution of A032349 with A032349 shift right. January 1, 2005
A110030 Number of consecutive integers starting with n needed to sum to a Niven number. July 8, 2005
A112886 Triangle-free positive integers. January 12, 2006
A120007 Möbius transform of sum of prime factors of n June 2, 2006



The URL field gives the preferred format for the URL to link to the sequence in question, to simplify cut and paste.


The sequence field lists the numbers themselves, or at least about four lines' worth. The sequence field makes no distinction between sequences that are finite but still too long to display and sequences that are infinite. To help make that determination, you need to look at the keywords field for "fini," "full," or "more." To determine to which n the values given correspond, see the offset field, which gives the n for the first term given.

Any negative signs are stripped from this field, and the values with signs are put in the Signed field.


The signed field is almost the same thing as the sequence field except that it shows negative signs. This field is only included for sequences that have negative values. Any entry with this field must have the keyword "sign".


The name field usually contains the most common name for the sequence, and sometimes also the formula. For example, 1, 8, 27, 64, 125, 216, 343, 512, is named "The cubes: a(n) = n^3."


The comments field is for information about the sequence that doesn't quite fit in any of the other fields. The comments field often points out interesting relationships between different sequences and less obvious applications for a sequence. For example, Lekraj Beedassy in a comment to A000578 notes that the cube numbers also count the "total number of triangles resulting from criss-crossing cevians within a triangle so that two of its sides are each n-partitioned," while Sloane points out the unexpected relationship between centered hexagonal numbers and second Bessel polynomials in a comment to A003215.

If no name is given for a comment, the comment was made by the original submitter of the sequence.

Maple, Mathematica, and other programs

Maple and Mathematica are the preferred programs for calculating sequences in the OEIS, and they both get their own field labels, "Maple" and "Mathematica." As of July 2008, there are over 19,000 Mathematica programs and 12,000 Maple programs.

Any other program gets a generic "Program" field label and the name of the program in parentheses. The OEIS has programs in PARI, Magma, MATLAB, Python, and even Microsoft Excel.

If there is no name given, the program was written by the original submitter of the sequence.

See also



A035292 1, 3, 8, 3, 12, 24, 16, 3, 41, 36, 24, ... Number of similar sublattices of Z^4 of index n^2.
504, 420, 5760, 3360, 2688, 1260
Decomposition of Stirling's S(n, 2) based on
associated numeric partitions.
A002017 1, 1, 1, 0, -3, -8, -3, 56, 217, 64, -2951, -12672, ... Expansion of exp(sin x).
supporting stable period-3 orbits in the logistic equation.


The OEIS has its own standard set of four or five letter keywords that characterize each sequence:

  • base The results of the calculation depend on a specific positional base. For example, 2, 3, 5, 7, 11, 101, 131, 151, 181 ... are prime numbers regardless of base, but they are palindromic specifically in base 10. Most of them are not palindromic in binary. Some sequences rate this keyword depending on how they're defined. For example, the Mersenne primes 3, 7, 31, 127, 8191, 131071, ... does not rate "base" if defined as "primes of the form 2^n - 1." However, defined as "repunit primes in binary," the sequence would rate the keyword "base."
  • bref "sequence is too short to do any analysis with", for example, , Number of isomorphism classes of associative non-commutative non-anti-associative anti-commutative closed binary operations on a set of order n.
  • cofr The sequence represents a continued fraction.
  • cons The sequence is a decimal expansion of an important mathematical constant, like e or π.
  • core A sequence that is of foundational importance to a branch of mathematics, such as the prime numbers, the Fibonacci sequence, etc.
  • dead This keyword used for erroneous sequences that have appeared in papers or books, or for duplicates of existing sequences. For example, is the same as A000668.
  • dumb One of the more subjective keywords, for "unimportant sequences," which may or may not directly relate to mathematics. , "Mix digits of pi and e." is one example of the former, and , "Numbers on a computer keyboard, read in a spiral." is an example of the latter.
  • eigen A sequence of eigenvalues.
  • fini The sequence is finite, although it might still contain more terms than can be displayed. For example, the sequence field of shows only about a quarter of all the terms, but a comment notes that the last term is 3888.
  • frac A sequence of either numerators or denominators of a sequence of fractions representing rational numbers. Any sequence with this keyword ought to be cross-referenced to its matching sequence of numerators or denominators, though this may be dispensed with for sequences of Egyptian fractions, such as , where the sequence of numerators would be . This keyword should not be used for sequences of continued fractions, cofr should be used instead for that purpose.
  • full The sequence field displays the complete sequence. If a sequence has the keyword "full," it should also have the keyword "fini." One example of a finite sequence given in full is that of the supersingular primes , of which there are precisely fifteen.
  • hard The terms of the sequence cannot be easily calculated, even with raw number crunching power. This keyword is most often used for sequences corresponding to unsolved problems, such as "How many spheres can touch another sphere of the same size?" lists the first ten known solutions.
  • less A "less interesting sequence".
  • mult The sequence corresponds to a multiplicative function. Term a(1) should be 1, and term a(mn) can be calculated by multiplying a(m) by a(n) if m and n are coprime. For example, in , a(12) = a(3)a(4) = -8 × -3.
  • nonn The sequence consists of nonnegative integers (it may include zeroes). No distinction is made between sequences that consist of nonnegative numbers only because of the chosen offset (e.g, n3, the cubes, which are all positive from n = 0 forwards) and those that by definition are completely nonnegative (e.g., n2, the squares).
  • probation Sequences that "may be deleted later at the discretion of the editor."
  • tabf "An irregular (or funny-shaped) array of numbers made into a sequence by reading it row by row." For example, , "Triangle read by rows giving successive states of cellular automaton generated by "rule 62."
  • uned Sloane has not edited the sequence but believes it could be worth including in the OEIS. The sequence could contain computational or typographical errors. Contributors are invited to ponder the sequence and send Sloane their edition.
  • unkn "Little is known" about the sequence, not even the formula that produces it. For example, , which was presented to an Internet oracle to ponder.
  • word Depends on the words of a specific language. For example, zero, one, two, three, four, five, etc., 4, 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, 6, 8, 8, 7, 7, 9, 8, 8 ... , "Number of letters in the English name of n, excluding spaces and hyphens."








The author of the sequence is the person who submitted the sequence, even if the sequence has been known since ancient times. The name of the submitter is given first name (spelled out in full), middle initial(s) (if applicable) and last name; this in contrast to the way names are written in the reference fields. The e-mail of the submitter is also given, with the @ character replaced by "(AT)". For most sequences after A055000, the author field also includes the date the submitter sent in the sequence. But when the submitter is one of the most frequent contributors the author field just has initials; "njas" for Neil Sloane himself, for example.

Searching the OEIS

The previous version of the main look-up page of the OEIS offered three ways to look up sequences, and the right radio button had to be selected. There was an advanced look-up page, but its usefulness has been integrated into the main look-up page in a major redesign of the interface in January 2006.

Enter a sequence

Enter a few terms of the sequence, separated by either spaces or commas (or both).

You can enter negative signs, but they will be ignored. For example, 0, 3, 7, 13, 20, 28, 36, 43, 47, 45, 32, 0, -64, n2 minus the nth Fibonacci number, is a sequence that is technically not in the OEIS, but the very similar sequence 0, -3, -7, -13, -20, -28, -36, -43, -47, -45, -32, 0, 64, is in the OEIS and will come up when one searches for its reversed signs counterpart.

However, the search can be forced to match signs by using the prefix "sign:" in the search string. This is especially useful for sequences like that consist exclusively of positive and negative ones.

One can enter as little as a single integer or as much as four lines of terms. Sloane recommends entering six terms, a(2) to a(7), in order to get enough results, but not too many results. There are cases where entering just one integer gives precisely one result, such as 6610199 brings up just , the strobogrammatic primes which are not palindromic). And there are also cases where one can enter many terms and still not narrow the results down all that much.

Enter a word

Enter a string of alphanumerical characters. Certain characters, like accented foreign letters, are not allowed. Thus, to search for sequences relating to Znám's problem, try enter it without the accents: "Znam's problem." The handling of apostrophes has been greatly improved in the 2006 redesign. The search strings "Pascal's triangle," "Pascals triangle" and "Pascal triangle" all give the desired results.

To look up most polygonal numbers by word, try "n-gonal numbers" rather than "Greek prefix-gonal numbers" (e.g., "47-gonal numbers" instead of "heptaquartagonal numbers"). Beyond "dodecagonal numbers," word searching with the Greek prefixes might fail to yield the desired results.

Enter a sequence number

Enter the modern OEIS A number of the sequence, with the letter A and with or without zero-padding. As of 2006, the old M and N sequence numbers will yield the proper result as search strings, e.g., a search for M0422 will correctly bring up , the number of entries in nth row of Pascal's triangle not divisible by 3 (M0422 in the book The Encyclopedia of Integer Sequences) and not , concatenation of numbers from n down to 1.

Searching from a web browser

An OpenSearch compatible web browser (such as Firefox 2.0 or Internet Explorer 7) can have OEIS added to its toolbar based search list by adding a provider with the following URL: One can then directly enter the sequence, e.g. "1,2,6,24,120" (without quotes) into the search bar and search OEIS easily.

External links

Papers on OEIS by Neil Sloane

Search another word or see Online Encyclopedia of Integer Sequenceson Dictionary | Thesaurus |Spanish
Copyright © 2014, LLC. All rights reserved.
  • Please Login or Sign Up to use the Recent Searches feature