There is an error in your arithmetic:
$$73*7 = 511 = 5*102 + 1$$
Thus when you substitute in $d = 40k + 7$ you should get $64k \equiv 0 \pmod{102}$ instead of $\equiv -6$.
There is an error in your arithmetic:
$$73*7 = 511 = 5*102 + 1$$
Thus when you substitute in $d = 40k + 7$ you should get $64k \equiv 0 \pmod{102}$ instead of $\equiv -6$.