Class BigIntTriangle

    • Constructor Detail

      • BigIntTriangle

        public BigIntTriangle()
        Create a triangle without data. Rows may be added with the addRow() method.
      • BigIntTriangle

        public BigIntTriangle​(int n,
                              BigInteger init)
        Creates an initialized number triangle with n rows.
        Parameters:
        n -
        init - The value with which the triangle entries are initialized.
    • Method Detail

      • get

        public BigInteger get​(int n,
                              int k)
        Returns the entry T[n,k], with T[1,1] being the very first element.
        Parameters:
        n -
        k -
        Returns:
        T[n,k]
      • set

        public void set​(int n,
                        int k,
                        BigInteger value)
        Sets the value T[n,k].
        Parameters:
        n -
        k -
        value -
      • getRow

        public ArrayList<BigInteger> getRow​(int n)
        return n.th row, where the first row has index 1.
        Parameters:
        n -
        Returns:
        n.th row
      • getRowSum

        public BigInteger getRowSum​(int n)
        Returns the sum over all entries of the n.th row, where the first row has index 1.
        Parameters:
        n -
        Returns:
        the sum over all entries of the n.th row
      • getRowSums

        public ArrayList<BigInteger> getRowSums()
        Returns:
        List of row sums of this triangle.
      • toList

        public ArrayList<BigInteger> toList()
        Returns:
        This triangle converted into a list read by rows. Better suited for OEIS lookups.