The basic question is : has this system been considered before, and how do I find it? References to the literature would be most welcome, but I am asking for reasonable search terms. I will try the OEIS soon.

We are going to generate for each prime $p$ some fractions which are $k= \pi(p)$ in number. The denominators will be primarily divided by 2, and otherwise I am not going to simplify them. So for $p=5$ the last fraction could be written as $2/5$, but I will keep it at $6/15$ and just write the numerators. First, some numerators for the first four primes with denominator in parentheses.

1 (1)

1 2 (3)

1 8 6 (15)

1 22 58 24 (105)

I am generating a distribution of sizes of sets of (what I temporarily call) remainders modulo the first $k$ primes, so the $j$th fraction in each row indicates the proportion of occurrences where I have $j$ distinct remainders. Given a row for the prime before $p$, the denominator is $p$ times the previous denominator, the first entry is 1, and the $j$th entry is ($j$ times the $j$th entry in the previous row) plus (($p+1-j$ times the $(j-1)$th entry in the previous row). The final entry in each row is a product of terms of the form $(p-k)$. So the 58 above says more than half (58/105) of the numbers $n$ have exactly two distinct classes of numbers of the form $q*Ceil(n/q)$ where I let $q$ run over the $k=4$ smallest primes. (This set of ceiling numbers can have from 1 up to $k$ many members, but I just care about the relative sizes of the sets and not their arrangement on the number line.)

I would actually like some bounds on the expected value of $j$ given this distribution. It feels like the expected value should be near $k(e-1)/e$ , but I am doing the calculations by hand and have not gotten far. In any case I want to know if this system is in the literature, or how to have a good chance of finding it if it is.

Gerhard "My Kingdom For Search Terms?" Paseman, 2018.04.13.