This program is a FizzBuzz variant based on Fibonacci numbers F(n). Given a natural number n, the program prints one of the following for every Fibonacci number F(n) from 1 to n:
- BuzzFizz if F(n) is prime (a Fibonacci prime),
- FizzBuzz if F(n) is divisible by 15,
- Buzz if F(n) is divisible by 3,
- Fizz if F(n) is divisible by 5,
- F(n) otherwise.
The program is implemented in Go (golang) and uses the Miller-Rabin primality test with 64 iterations (see Appendix C.3 of FIPS PUB 186-4 for a rationale) to detect composite numbers.
The program can be installed and run by issuing the commands
$ go get github.com/cconrads-scicomp/fizzbuzz-with-fibonacci-primes
$ fizzbuzz-with-fibonacci-primes 20
in your shell. Installation instructions for the Go programming language can be found here.