Well, here is a hack that might work for you (it did here)
In the initialize script of your root form place something like below which builds an array of page numbers
form1::initialize - (JavaScript, client)
var pagecnt = 1;
var secinput = new Array(2,4,3); // <-- fill this array from your data/interface
var pagelength = secinput.reduce(function(a, b) { return a + b; }, 0); // <-- get the overall number of pages or let it be calculated like this
pageout = new Array(pagelength+1); // make sure you do not put var in front which makes this array global
for (var i=0; i<secinput.length; i++) {
for (var j=0; j<secinput[i]; j++) {
pageout[pagecnt] = "" + (j+1) + "/" + secinput[i];
pagecnt++;
}
}
The pageout array contains ["1/2", "2/2", "1/4", "2/4", ....]
Then in the layout:ready event of a Text with floating field (like the Page # of # - I used Page #) that is placed on your master page have the following script:
form1.#pageSet[0].Page1.CurrentPage::ready:layout - (JavaScript, client)
var currpage = xfa.layout.page(this);
this.rawValue = pageout[currpage];
That produces in sequence on your pages:
Page 1/2
Page 2/2
Page 1/4
...