# Problem Description
This is a hexagonal pyramid number pattern problem where we need to generate the nth row of numbers following specific rules. Each row contains numbers arranged in hexagonal cells, with the first row having one cell, and each subsequent row adding one more cell than the previous row. The function should return all numbers in the requested row as a list.

# Visual Facts
1. The structure is a triangular arrangement of hexagonal cells
2. Each row n contains n cells
3. Row 1: [2]
4. Row 2: [2, 2]
5. Row 3: [2, 4, 2]
6. Row 4: [2, 8, 8, 2]
7. Row 5: [2, 16, 64, 16, 2]
8. All rows start and end with 2
9. The arrow marks in the image indicate multiplication relationships between cells

# Visual Patterns
1. Pattern for number of elements:
   - Row n contains n elements

2. Edge elements pattern:
   - First and last elements of every row are always 2

3. Middle elements calculation pattern:
   - For row ≥ 3, each non-edge cell is calculated by multiplying the two cells above it
   - Example: In row 4, 8 = 2 × 4 (from row 3)
   - Example: In row 5, 64 = 8 × 8 (from row 4)

4. Symmetry pattern:
   - Each row is symmetrical from left to right
   - Example: Row 4: [2, 8, 8, 2]
   - Example: Row 5: [2, 16, 64, 16, 2]


# Solution
from typing import List

def solution(n: int) -> List[int]:
    """
    Returns the numbers in the specified row.

    Parameters:
        n (int): The row number to retrieve. (n > 1)

    Returns:
        List[int]: A list containing all numbers in the nth row.     
    """
    ret = list()
    for i in range(n):
        row = list()
        for j in range(0, i + 1):
            if j == 0 or j == i:
                row.append(2)
            else:
                row.append(ret[i - 1][j] * ret[i - 1][j - 1])
        ret.append(row)
    return ret[n - 1]


# Test Script
def test():
    test_cases = [
        (1, [2]),
        (2, [2, 2]),
        (3, [2, 4, 2]),
        (4, [2, 8, 8, 2]),
        (5, [2, 16, 64, 16, 2]),
        (6, [2, 32, 1024, 1024, 32, 2]),
        (7, [2, 64, 32768, 1048576, 32768, 64, 2]),
        (8, [2, 128, 2097152, 34359738368, 34359738368, 2097152, 128, 2]),
        (9, [2, 256, 268435456, 72057594037927936, 1180591620717411303424, 72057594037927936, 268435456, 256, 2]),
        (10, [2, 512, 68719476736, 19342813113834066795298816, 85070591730234615865843651857942052864, 85070591730234615865843651857942052864, 19342813113834066795298816, 68719476736, 512, 2]),
    ]

    for n, expected_output in test_cases:
        try:
            output = solution(n)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`n`: {n}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message

        if output != expected_output:
            error_message = (
                f"The following Test Case failed:\n"
                f"`n`: {n}\n\n"
                f"Actual Output: {output}\n"
                f"Expected Output: {expected_output}"
            )
            assert False, error_message

test()