What's causing the poor randomness in this program: the LCG, or the program logic itself?
Let's say I choose $m = 8192$, $a = 4801$, and $c = 83$. By looking at the value of $x$, I can learn quite a lot about the value of $y$: for any $x$, there are only about nine or ten possible subsequent $y$s, and they're very unevenly distributed. 


With a LCG every $L_1$ has a single possible $L_2$, and for a maximal period the reverse is also true. With your formula each $x$ corresponds to about $m/52$ possible $L_1$, and thus $m/52$ possible $L_2$.

The form of the $L_1$ for a given $x$ is $L_1 = x + 52n$, for some $n$. Thus the $L_2$ for a given $x$ is:

$$L_2 = (52an + ax + c) \mod m$$

What you wish is for different values of $n$ to give different $L_2$, i.e. for it to be a decent LCG where $a' = 52a$ and $c' = ax + c$. Substitute $a$ and you get $a' = 3892 = 2^2 \cdot 7 \cdot 139$. For maximal period $a'-1 = 3891 = 3 \cdot 1297$ would have to be divisible by 4 (due to $m$ being), which it is not, so this will give very poor results, as you observe.

If you fixed this, e.g. by choosing another value for $m$, you would also need to consider a condition for $c'$ and how the subsequent modular reductions and addition of $x$ affect it. Also, reducing a random number from the range $0 \le x &lt; m$ modulo 52 will always be biased towards the small numbers unless $m$ is a multiple of 52.