Skip to main content
removed unnecesary `)`
Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Retina, 8181 80 bytes

K`0. "$+"{+`(1(\.)|(1\.(0?1)*0?)1)(00|$) ${3}0${2}11 0\. 1. )+0`0?1(\.?)1 10${1}0 

Try it online!Try it online! Works by repeatedly adding \$ 1 \$. Explanation:

K`0. 

Start off with \$ 0. \$.

"$+"{` )` 

Repeat the number of times given by the input.

+`(1(\.)|(1\.(0?1)*0?)1)(00|$) ${3}0${2}11 

If the \$ \phi^0 \$ bit is set, use the identity \$ \phi^0 = \phi^{-1} + \phi^{-2} \$ to move bits away until there is enough room.

0\. 1. 

Add \$ 1 \$.

)+0`0?1(\.?)1 10${1}0 

Minimise the number of bits by reversing the above identity.

Retina, 81 bytes

K`0. "$+"{+`(1(\.)|(1\.(0?1)*0?)1)(00|$) ${3}0${2}11 0\. 1. )+0`0?1(\.?)1 10${1}0 

Try it online! Works by repeatedly adding \$ 1 \$. Explanation:

K`0. 

Start off with \$ 0. \$.

"$+"{` )` 

Repeat the number of times given by the input.

+`(1(\.)|(1\.(0?1)*0?)1)(00|$) ${3}0${2}11 

If the \$ \phi^0 \$ bit is set, use the identity \$ \phi^0 = \phi^{-1} + \phi^{-2} \$ to move bits away until there is enough room.

0\. 1. 

Add \$ 1 \$.

)+0`0?1(\.?)1 10${1}0 

Minimise the number of bits by reversing the above identity.

Retina, 81 80 bytes

K`0. "$+"{+`(1(\.)|(1\.(0?1)*0?)1)(00|$) ${3}0${2}11 0\. 1. +0`0?1(\.?)1 10${1}0 

Try it online! Works by repeatedly adding \$ 1 \$. Explanation:

K`0. 

Start off with \$ 0. \$.

"$+"{` 

Repeat the number of times given by the input.

+`(1(\.)|(1\.(0?1)*0?)1)(00|$) ${3}0${2}11 

If the \$ \phi^0 \$ bit is set, use the identity \$ \phi^0 = \phi^{-1} + \phi^{-2} \$ to move bits away until there is enough room.

0\. 1. 

Add \$ 1 \$.

+0`0?1(\.?)1 10${1}0 

Minimise the number of bits by reversing the above identity.

Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Retina, 81 bytes

K`0. "$+"{+`(1(\.)|(1\.(0?1)*0?)1)(00|$) ${3}0${2}11 0\. 1. )+0`0?1(\.?)1 10${1}0 

Try it online! Works by repeatedly adding \$ 1 \$. Explanation:

K`0. 

Start off with \$ 0. \$.

"$+"{` )` 

Repeat the number of times given by the input.

+`(1(\.)|(1\.(0?1)*0?)1)(00|$) ${3}0${2}11 

If the \$ \phi^0 \$ bit is set, use the identity \$ \phi^0 = \phi^{-1} + \phi^{-2} \$ to move bits away until there is enough room.

0\. 1. 

Add \$ 1 \$.

)+0`0?1(\.?)1 10${1}0 

Minimise the number of bits by reversing the above identity.