Class FibonacciSequence

java.lang.Object
org.episteme.core.mathematics.sequences.FibonacciSequence
All Implemented Interfaces:
InfiniteSequence<Integer>, Sequence<Integer>

public class FibonacciSequence extends Object implements InfiniteSequence<Integer>
Represents the Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, ...
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • FibonacciSequence

      public FibonacciSequence()
  • Method Details

    • get

      public Integer get(int index)
      Description copied from interface: Sequence
      Returns the element at the specified index (0-based).
      Specified by:
      get in interface Sequence<Integer>
      Parameters:
      index - the index of the element to retrieve
      Returns:
      the element at the specified index
    • isConvergent

      public boolean isConvergent()
      Description copied from interface: InfiniteSequence
      Checks if the sequence converges to a limit.
      Specified by:
      isConvergent in interface InfiniteSequence<Integer>
      Returns:
      true if the sequence converges, false otherwise
    • limit

      public Integer limit()
      Description copied from interface: InfiniteSequence
      Returns the limit of the sequence if it converges.
      Specified by:
      limit in interface InfiniteSequence<Integer>
      Returns:
      the limit of the sequence