Interface IntegerSequence

All Superinterfaces:
Function<Natural,Integer>, Function<Natural,Integer>, Relation<Natural,Integer>, Sequence<Integer>
All Known Implementing Classes:
BellSequence, CatalanSequence, FactorialSequence, FibonacciSequence, PrimePiSequence, PrimeSequence, SquareSequence, TriangularSequence

public interface IntegerSequence extends Sequence<Integer>
A sequence of integers (ℤ).

Most OEIS sequences are integer sequences. This interface uses Episteme

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

    • getLong

      default long getLong(int n)
      Convenience method for small indices that fit in a long.

      Use this when you know the sequence value will fit in a long. For arbitrary-precision results, use Sequence.get(Natural) or Sequence.get(int).

      Parameters:
      n - the index
      Returns:
      a(n) as long
      Throws:
      ArithmeticException - if the value doesn't fit in a long
    • getLong

      default long getLong(Natural n)
      Convenience method to get value as long using Natural index.
      Parameters:
      n - the index
      Returns:
      a(n) as long
      Throws:
      ArithmeticException - if the value doesn't fit in a long