Expansions
NAME
Math::NumberTheory::Expansions
SYNOPSIS
use Math::NumberTheory::Expansions;
say number-expansion(pi, t => "Engel", :10n); # β [1, 1, 1, 8, ...]
say number-expansion(3/19, type => "Sylvester"); # β [7, 67]
say number-expansion(384, "Cantor"); # β [0, 0, 0, 1, 3]
say number-expansion(pi, t => "CantorProduct", :5number-of-terms); # β [1, 2, 22, 600, ...]
say number-expansion(5/13, "Lueroth"); # β [3, [3,4,2]] (periodic)
say from-number-expansion([2, 7, 3, 2, 2, 2, 2, 2], 'lueroth'); # approx. reconstruction
say from-number-expansion([1,1,1,8,8], type => "Engel"); # approx. reconstruction
say from-number-expansion((1, 0, 1, 0, 1, 0, 1), 'Zeckendorf'); # exact reconstruction (33)