is the golden ratio.
Any positive integer can be represented as a sum of powers of with integer exponents:
If we add the constraint that no exponent are consecutive, this representation is unique.
This representation is called the phinary representation of an integer.
For an integer n, we define M(n) as the sum of all exponents in its phinary representation:
In the range , find the minimun for M, the first integer which reaches the minimum, the maximum, and the first integer which reaches the maximum
Answer format: // -17,77,8,46 for the range
[My timing: 10 sec]
P.S:
Thanks to sinan for his suggestions which made this problem more interesting.