Devise an algorithm for writing any positive base ten integer in base φ number system.
**** φ, called the Golden Ratio is a positive real number equal to (1+√5)/2
(In reply to
my take on it by Charlie)
I had hoped to gain precision by exploiting the Fibonacci relationship (see my post) such that each calculation of a power of Phi involves one call to 5^(.5) and one division by 2. I hoped this would be more precise than raising Phi to various powers.
But what I'm not sure about is how much this may or may not have helped. For one thing, I'm not sure how precise Python represents the square root of 5.
I did just now find online a discussion of reducing or expanding the number of 1's in a Base Phi Representation, but it was not at all intuitively obvious to me why there is an equivalence between occurrences of 011 and 100 -- that is it wasn't intuitive until I looked once more at the table of powers of Phi in [a,b] notation.
Aha! The n-th power of Phi is the sum of the 2 next smaller powers.
|
Posted by Larry
on 2022-01-27 15:11:09 |