Directory macros/generic/zeckendorf
Source: zeckendorf.dtx Version: 0.9c, 2025/10/17 Author: Jean-François Burnol Keywords: Zeckendorf representation; Knuth Fibonacci multiplication License: LPPL 1.3c
Aim
This package extends \xinteval's syntax:
- The four operations are overloaded to do algebra in
Q(phi), where phi is a variable standing for the golden ratio. - Functions are available in this syntax to compute:
- Fibonacci numbers,
- Zeckendorf representations of positive integers (as lists of indices),
- Bergman phi-representations of positive elements of
Z[phi](as lists of exponents).
- The
$character serves as infix operator computing the Knuth Fibonacci multiplication of positive integers.
The macro interface also provides conversion of integers to Zeckendorf words and Bergman phi-ary representations.
The functionalities can be used in three ways:
- as a LaTeX package:
\usepackage{zeckendorf}, - as a Plain ε-TeX macro file:
\input zeckendorfcore.tex, - or interactively on the command line:
etex zeckendorf. If available use ratherrlwrap etex zeckendorffor a smoother experience.
The package is in alpha stage and its user interface may change in backwards incompatible ways. Of course, suggestions are most welcome.
Installation
Exert etex zeckendorf.dtx to extract macro files. To build the documentation run xelatex on the extracted zeckendorf-doc.tex, or directly on zeckendorf.dtx.
The recommended TDS structure is:
/tex/generic/zeckendorf/zeckendorfcore.tex /tex/generic/zeckendorf/zeckendorf.tex /tex/generic/zeckendorf/zeckendorf.sty /source/generic/zeckendorf/zeckendorf.dtx /doc/generic/zeckendorf/zeckendorf-doc.pdf /doc/generic/zeckendorf/README.md
License
Copyright © 2025 Jean-François Burnol
This Work may be distributed and/or modified under the conditions of the LaTeX Project Public License 1.3c. This version of this license is in
http://www.latex-project.org/lppl/lppl-1-3c.txt
and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later.
This Work has the LPPL maintenance status "author-maintained".
The Author and Maintainer of this Work is Jean-François Burnol.
This Work consists of the main source file and its derived files
zeckendorf.dtx, zeckendorfcore.tex, zeckendorf.tex, zeckendorf.sty, README.md, zeckendorf-doc.tex, zeckendorf-doc.pdf
Download the contents of this package in one zip archive (213.8k).
zeckendorf – Knuth Fibonacci multiplication, Zeckendorf and Bergman representations of big integers
This package extends the \xinteval syntax to do algebra in Q(phi) (where phi is the golden ratio), and compute Fibonacci numbers, Zeckendorf representations of positive integers and Bergman phi-representations of the positive elements of Z[phi]. The $ character is used to compute the Knuth Fibonacci multiplication.
The package can be used either in a LaTeX document, or with Plain ε-TeX, or on the command line in an interactive session using ε-TeX.
Being based upon xintexpr, it allows to compute with “arbitrarily” big integers, the reasonable use being with integers of at most a few hundreds of digits.
| Package | zeckendorf |
| Version | 0.9c 2025-10-17 |
| Licenses | The LaTeX Project Public License 1.3c |
| Copyright | 2025 Jean-François Burnol |
| Maintainer | Jean-François Burnol |
| Contained in | TeX Live as zeckendorf MiKTeX as zeckendorf |
| Topics | Arithmetic Calculation |