Skip to content

tonyb7/zeckendorf-sequences

Repository files navigation

Generator for Simple Zeckendorf Sequences

Tony Bai
July 14, 2019

Inspiration

Annie asked me to help her develop an algorithm to generate Simple Zeckendorf Sequences in 2 dimensions. The definition for such sequences can be found in a mathematical paper from Williams College titled Gaussian Behavior In Zeckendorf Decompositions From Lattices by Chen et al. The following image is taken from the paper, and shows the first 45 entries of the two-dimensional sequence.

How to Run This Program

  1. Download this repository and navigate to it in terminal
  2. Compile the C++ file with g++ zeckendorf.cpp -o -std=c++11 zeckendorf
  3. Run the executable with ./zeckendorf
  4. Follow the prompts

Example:

The executable is included in this repository in case you don't want to/can't compile the C++ file and wanted to give running the executable compiled on my Mac a shot (skip steps 1-2 in this case).

Issues & Limitations

If you want to generate bigger numbers and the ouput starts getting funky within the printGrid function, simply increase the parameter passed to cout.width().

It seems like the program can only execute reasonably fast (under 20 seconds) on my computer for up to about 23 rows as of now.

Extensions

If you want to implement this algorithm for higher dimensions or optimize it, feel free to read & edit zeckendorf.cpp. It should be clear how to implement this algorithm for 3 or more dimensions -- it would involve more nested vectors, but the idea behind the algorithm is the same.

About

Generator for Simple Zeckendorf Sequences

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages