def page_numbers(max=5)
      if last_page > max
        [1] + [nil] + ((last_page-max+2)..last_page).to_a
      else
        (1..last_page).to_a
      end
    end
def page_numbers(max=5)
      if last_page > max
        [1] + [nil] + ((last_page-max+2)..last_page).to_a
      else
        (1..last_page).to_a
      end
    end
return array with page numbers
 topic.page_numbers => [1, 2, 3, 4] #when pages count is 4
 topic.page_numbers => [1, 2, 3, 4, 5] #when pages count is 5
 topic.page_numbers => [1, nil, 3, 4, 5, 6] #when pages count is 6
 topic.page_numbers => [1, nil, 4, 5, 6, 7] #when pages count is 7