Skip to content

christoph-conrads/fizzbuzz-with-fibonacci-primes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FizzBuzz with Fibonacci Primes

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.

About

FizzBuzz with Fibonacci primes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages