Skip to main content
20-Turquoise
November 25, 2016
Solved

Zeckendorf representation with Lucas numbers ?

  • November 25, 2016
  • 2 replies
  • 3056 views

Hello Everyone.

From :

(1).png

(2).PNG

(3).PNG

The question is : Need help creating a Program Function for "Zeckendorf Representation for Natural Number (2017) with Lucas Numbers ?

      Thanks in advance for your time and help.

            Best Regards.

Best answer by Werner_E

Here you are. The problem was that the first two Lucas numbers are not in sequence and so had to be treated differently to return the correct index for the first two sequence elements. This is solved now in a different way and the routine works OK as long as the initial value is >=0

2 replies

25-Diamond I
November 26, 2016

Isn't that a quite easy task?

Or am I missing the point?

lvl10720-TurquoiseAuthor
20-Turquoise
November 27, 2016

I'm very, very happy with your answer, Werner. .   I greatly appreciate your time and help.

     Best Regards.

25-Diamond I
November 27, 2016

Here's a slightly modified version which returns the numbers themselves, too.

lvl10720-TurquoiseAuthor
20-Turquoise
November 27, 2016

Thanks again, Werner. I very,very . And I guess your Program Function could apply for : "Zeckendorf representation for certain Natural number with both of Fibonacci numbers and Lucas numbers :

(4).PNG

But I guess : "Zeckendorf representation for certain Natural number with Fibonacci numbers" would choose  F[2 instead of F[1  ???

(5).PNG

So could we modify the Program Function above suit with Zeckendorf representation and apply to both of Fibonacci numbers and Lucas numbers ?

         Best Regards.

              Loi

Werner_E25-Diamond IAnswer
25-Diamond I
November 27, 2016

Here you are. The problem was that the first two Lucas numbers are not in sequence and so had to be treated differently to return the correct index for the first two sequence elements. This is solved now in a different way and the routine works OK as long as the initial value is >=0