def pentagonal(n: int) -> int:
    """Find the number of dots in nth pentagonal number."""
    # Find the pentagonal number to nth degree.
    pentagonal_number = (n * ((3 * n) - 1) // 2)

    # Find the total number of dots.
    dots = ((n-1) ** 2)
    dots += pentagonal_number
    return dots