I'm working on a problem about shuffling decks, using https://mathworld.wolfram.com/Out-Shuffle.html
So I need to find all deck sizes $n$ where you can shuffle (using out-shuffle) so that it returns to the original order in a given number $k$ shuffles.
What I've gathered, after help from the friendly folks here at Math Stack Exchange, is that I need to factorize the following, for my given $k$:
$$ 2^{k} \equiv 1 \mod (n-1) $$
i.e factorize for
$$ 2^{k} - 1 $$
For $k=8$, I know from a brute-force attempt, that the correct list of deck sizes should be:
$$ [18, 52, 86, 256] $$
How do I go from the above formulas to all the divisors, to this list?