Skip to main content

For challenges involving sequences, typically of numbers following some pattern.

This tag indicates that the challenge uses sequences. They may be mathematical sequences, or they may be sequences of different things.

The following rules apply to challenges by default:

  • Indexing: Allowed are both \$0\$- and \$1\$-based indexing, and the following rules can be applied with both these types of indexing.
  • Format: The answers can use one of the following input/output methods:
    • Given some index \$n\$ it can return the \$n\$-th entry of the list.
    • Given some index \$n\$ it can return all entries up to the \$n\$th one in the sequence.
    • Without taking any index, it can output all entries by e.g. ...
      • ...printing them one by one (potentially infinitely) or...
      • ...returning a list (lazy if the sequence is infinite) or...
      • ...returning a generator that represents the whole sequence.