Finite Integer Index of Pathwidth and Treewidth