RosettaCodeData/Task/Zeckendorf-number-representation/Mathematica/zeckendorf-number-representation.math
2023-07-01 13:44:08 -04:00

6 lines
190 B
Text

ZeckendorfRepresentation[0] = 0;
ZeckendorfRepresentation[n_Integer?Positive]:=
NumberDecompose[n, Reverse@Fibonacci@Range[2,1000]] // FromDigits
ZeckendorfRepresentation /@ Range[0, 20]