A magic die, with the numbers 1, 2, 3, 4, 6, and 7 on its six faces, is rolled.
After this roll, if an odd
number appears on the top face, all odd numbers on the die are squared.
If an even number appears on the top face, all the previously odd numbers are increased by 3 and then all the even numbers are halved and then squared.
If the given die changes as described and assuming a perfectly balanced die,
what is the probability that the number appearing on the second roll
of the die is 1 mod 8?