def pagination_helper(page: int, last_page: int):
    """
    Provides pagination assistance for BacklogView.
    @param page: The number of the page currently being viewed by the user.
    @param last_page: The number of the last page in the user's backlog.
    @return: A range of page numbers to be displayed on the backlog's paginator.
    """
    if last_page > 5:
        if page > 3:
            end = min(page + 2, last_page)
            start = page - 2 if end != last_page else last_page - 4
            page_range = range(start, end + 1)
        else:
            page_range = range(1, 6)
    else:
        page_range = range(1, last_page + 1)

    return page_range