Class TriangularSequence

java.lang.Object
org.episteme.core.mathematics.analysis.series.TriangularSequence
All Implemented Interfaces:
Function<Natural,Integer>, Function<Natural,Integer>, Relation<Natural,Integer>, IntegerSequence, Sequence<Integer>

public class TriangularSequence extends Object implements IntegerSequence
Triangular numbers sequence: T(n) = n(n+1)/2.

OEIS A000217: Triangular numbers.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • TriangularSequence

      public TriangularSequence()
  • Method Details

    • get

      public Integer get(Natural n)
      Description copied from interface: Sequence
      Returns the n-th term of the sequence (0-indexed).

      This is the canonical method using Episteme number types.

      Specified by:
      get in interface Sequence<Integer>
      Parameters:
      n - the index (n ≥ 0)
      Returns:
      a(n)
    • getOEISId

      public String getOEISId()
      Description copied from interface: Sequence
      Returns the OEIS (Online Encyclopedia of Integer Sequences) identifier. For example, "A000045" for Fibonacci numbers.
      Specified by:
      getOEISId in interface Sequence<Integer>
      Returns:
      OEIS ID or null if not catalogued
    • getName

      public String getName()
      Description copied from interface: Sequence
      Returns a human-readable name for this sequence.
      Specified by:
      getName in interface Sequence<Integer>
      Returns:
      sequence name
    • getFormula

      public String getFormula()
      Description copied from interface: Sequence
      Returns a formula or description of how terms are computed.
      Specified by:
      getFormula in interface Sequence<Integer>
      Returns:
      mathematical formula or description
    • getCodomain

      public String getCodomain()
      Description copied from interface: Relation
      Returns the codomain description.
      Specified by:
      getCodomain in interface Relation<Natural,Integer>
      Returns:
      codomain name