Every year, VORtech calls attention to the International Day of Mathematics. This year, we decided to put out a programming challenge: the Pi-day challenge 2023. We’ve worked on this challenge internally at VORtech before and found some nice solutions, but we are very curious to see if anyone can beat us.
The Pisano period
The Fibonacci sequence starts with [0, 1, 1, 2, …] and has ever increasing numbers further down the series. If you take these numbers modulo n, then the series will eventually become periodical. This is called the Pisano period π(n). The series of Pisano numbers for n = [1, 2, 3, …] is A001175.
Write a function get_pisano_numbers() in Python, which for a list of numbers n returns the corresponding list of π(n). For example, get_pisano_numbers([1,3]) would return [1,8].
The winner is the function that is both the shortest and the fastest.
A readme file with more details about the rules and scoring and an example code can be found on our Github repository.
Please submit your solution by email to email@example.com before April 21th, 2023.
The solution that is both fastest and shortest receives the Pi enamel pin. The developers of the solutions that are either fastest or shortest but not both receive a pair of math socks.
Competition is obviously not open for employees of VORtech or their family members as they already had the opportunity to work on this.