6
Quinary is like binary, except that 1 is represented by the text of the program, and 0 is represented as the backwards text of the program.
The Fibonacci Sequence is the well known sequence
F(0) = 0, F(1) = 1, F(n) = F(n - 1) + F(n - 2)
Write a program that takes some input n and outputs the nth fibonacci number in quinary.
Standard code golf rules apply.
Can we read program code using filesystem IO? – Hannes Karppila – 2016-01-31T07:36:27.103
@HannesKarppila That's considered a standard loophole for quines. – Alex A. – 2016-01-31T07:37:01.707
Yes it is, but actually question does not use word quine, so I asked. Of course it usually is, but I wanted to be sure if that applies here. – Hannes Karppila – 2016-01-31T07:40:53.867
@Mego I believe you are supposed to output
F(n)
in binary, but with the reversed program for 0 and the program code for 1. So if your code was1234
, and the input was4
, you'd output12341234
(11), and for5
, you'd output123443211234
(101). – es1024 – 2016-01-31T07:51:47.843@es1024 Ah, thank you for clearing that up, I didn't read so well. – Mego – 2016-01-31T07:53:01.713
@Hannes, it's tagged [tag:quine] – Peter Taylor – 2016-01-31T07:53:49.810
1Is the program allowed to be a palindrome? (Same backwards and forwards) – Loovjo – 2016-01-31T09:17:54.017
@Loovjo yes, it is, but I don't think that makes it any easier – k_g – 2016-01-31T09:21:19.200