This topic in particular is very dear to my heart since I learnt the shuffle as a kid, and it was wonderful to rediscover it in a new light with some math background being an adult.
For those interested, the shuffle is also called "faro" shuffle and was likely invented to cheat at a game with the same name.
There's a wonderful book "Magic Tricks, Card Shuffling and Dynamic Computer Memories" that describes the mathematics of perfect shuffles, highly recommended!