Tony Bai
July 14, 2019
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.
- Download this repository and navigate to it in terminal
- Compile the C++ file with
g++ zeckendorf.cpp -std=c++11 -o bin/zeckendorf
- Run the executable with
./zeckendorf
- Follow the prompts
Example:
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.
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.