This site is supported by donations to The OEIS Foundation.

Offsets

From OeisWiki
Jump to: navigation, search

The offset in an OEIS sequence entry gives the index of the first term of the sequence (in other words, it tells us where the sequence starts).

Given a sequence of a function with offset 3, this tells us that the first listed corresponds to . Suppose is well-defined for all but not for any . Then the sequence must start at .

For arrays and triangles, the offset should be the index of the first row.

Examples of offsets

The most common offsets in the OEIS are 0 and 1. Offset 1 is used in particular for sequences that list numbers with a given property, "Numbers such that ...". (These sequences usually represent sets, or sometimes multisets, in which case the definition should say "listed with multiplicity".) The rationale is that a(1) is the first such number, and more generally a(n) is the n-th such number.

Several situations may require an offset other than 1:

  • Sequences that are functions for which the smallest possible argument is different from 1. In this case, the offset is equal to the smallest possible argument of the function (if such a smallest argument exists). This will more often be 0, rather than 1; see the section "Offset 0" below. If you consider submitting a function, think twice about whether it makes sense to define it for n ≥ 0 rather than only n ≥ 1, and if so, use offset 0.
  • Sequences giving the decimal expansion of a constant. In this case, the offset is equal to the number of digits before the decimal point.

Some particular cases are given in the sequel.

Offset −1

Of the small number of negative offsets in the OEIS, most are offset −1.

  • A002206 Numerators of logarithmic numbers (also of Gregory coefficients ).

Offset 0 (Functions that are defined for all nonnegative integers)

  • Functions that are defined for all nonnegative integers, and more pointedly, are a mapping from the integers to the integers. For example, . Theoretically, we could start our listing at −3 or −7, but these are rather arbitrary choices, and the choice of doesn't give a well-ordered (i.e., no first term) sequence. Therefore, the logical offset is 0 (indeed that is the offset of A000290). In any case, for this example, since , this presents no loss of information (otherwise, there may be two separate sequences, one for and the other for ).
  • Other functions that are defined for all nonnegative integers. For example, (see A000196).[1]

Offset 1 (Lists) (Functions that are defined for all positive integers)

The majority of sequences in the OEIS have offset 1. In particular, generally lists should be 1-indexed (rather than 0-indexed). For example, A003174 "Positive integers D such that Q[sqrt(D)] is a quadratic field which is norm-Euclidean" is a list of numbers, starting "2, 3, 5, 6..."; 2 is the 1st number in this list, so this sequence has offset 1. However, if a list of nonnegative integers starts from the number 0, it may have offset 0 (e. g., A000290 "The squares: a(n) = n^2" has offset 0).

Offset 2

Some sequences require arguments that have prime factors. Such sequences may have to start at 2 so as to avoid the problem of the non-primality of 1. (However, in some cases, convention dictates a special value for ; one example is the least prime factor function, A020639, for which convention dictates that , so that sequence has offset 1.)

  • A112823 Largest prime in any decomposition of into a sum of two primes. If a smaller value were chosen, not all values would be defined.

Offset 3

  • A002374 Largest prime in any decomposition of into a sum of two odd primes. If a smaller value were chosen, not all values would be defined.

Large offsets

  • Offset 12978189: A193864 Decimal expansion of the largest known prime number (as of 2011):
  • Offset 369693100: A241298 Decimal expansion of 9^(9^9) = 9^^3.
  • Offset 3638334640025: A241292 The decimal expansion of 3^(3^(3^3)) = 3^^4.
  • Offset 666262452970848504: A202955 Decimal expansion of

Some sequences have very large natural offsets, too large for inclusion in the Offset field. Such sequences are given an offset of 1 and an explanatory comment is added. Examples include A241293, A241294, A241295, A241296, and A241297.

Negative offsets

Negative offsets occur almost only in the "keyword:cons" sequences, cf the OEIS format for decimal representation of constants:

  • Offset −14827: A143531 Decimal expansion of the largest zero of Riemann's prime counting function R(x).
  • Offset −44: A078302 Decimal expansion of Planck time.

Secondary offset

Sequence entries (generally) show two numbers in the offset field. When contributing a new sequence or revising the initial term of an old sequence, you need only concern yourself with the first number.

The second number is the secondary offset. It is always 1-indexed, automatically assigned, and gives the first term such that . For example, with the Fibonacci numbers, 0, 1, 1, 2, 3, 5, 8, 13, ..., the sequence starts with and the fourth term shown is the first greater than 1. Thus the original contributor of the sequence put down 0 for the offset and the computer added a 4, hence the offset field of A000045 reads 0, 4. If there are no terms with absolute value greater than 1, this second number is sometimes omitted (see, e.g., A038219) and otherwise entered as 1.

In the unusual case that the first term with absolute value greater than 1 is not within term visibility, the second offset may be added manually (e.g., A193095). Note that it counts the terms in the sequence, not the offset of that first term! The secondary offset is used to sort sequences lexicographically for the sequence in context display, e.g., A0000402, 3, 5, 7, 11, … before A000045: 0, 1, 1, 2, 3, 5, 8, 13, …[2]

See also

OEIS sequence entry fields
Name · Data · Offset · Comments · References · Links · Formula · Example · Maple · Mathematica · Prog · Crossrefs · Keyword · Author · Extensions

Notes

  1. Of course, for negative integers, we need only multiply the values of this sequence by the imaginary unit, assuming we understand the definition as being , and that returns a real value that the floor function can then handle ordinarily.
  2. N. J. A. Sloane, Style sheet about offset, Seqfan, December 2018.