Project Euler 321 - Swapping Counters

Official link: https://projecteuler.net/problem=321