Class FibonacciSequence

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

public class FibonacciSequence extends Object implements IntegerSequence
Fibonacci sequence: F(0) = 0, F(1) = 1, F(n) = F(n-1) + F(n-2).

OEIS A000045: The Fibonacci numbers.

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

    • FibonacciSequence

      public FibonacciSequence()
  • 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