First child's share: 1 + (N-1)/10 = x.
Last child's share: x.
Penultimate child's share: n - 1 + x/9 = (N/x) - 1 + x/9 = x.
Consider the expression for the first child's share: N = 10x - 9.
Substituting into the equation for the penultimate child's share gives us
(10x - 9)/x - 1 + x/9 = xwhich can be written
8x2 - 81x + 81 = 0 or (x - 9)(8x - 9) = 0The number of marbles taken by each child being a whole number, the only possible solution is x = 9;
hence N = 81 and n = 9.
There were nine children. Each got nine marbles.