16
1
In Gödel, Escher, Bach, Douglas Hofstadter introduces an integer sequence which is commonly referred to as the figure-figure sequence:
2, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, ...
You may enjoy working out the definition of the sequence yourself as part of the challenge, but if you can't or don't want to figure it out you can find it on OEIS as sequence A030124 and a slightly clearer definition on Wikipedia.
Write a program or function which, given n
via STDIN, ARGV or function argument, prints a list of the first n
numbers of the sequence to STDOUT in any reasonable list format.
This is code golf, the shortest solution in bytes wins.
You've missed the s out of aditsu when typing the url for the interpreter – Beta Decay – 2014-09-10T10:44:26.540
@BetaDecay then why not edit to fix it ;) – Martin Ender – 2014-09-10T10:53:47.683
@Martin I didn't think I had enough rep... – Beta Decay – 2014-09-10T10:54:31.737
2@BetaDecay You don't, but you can still suggest them (which even gives you 2 rep if they are accepted). – Martin Ender – 2014-09-10T10:59:16.797
I felt so clever for golfing off 8 additional bytes of my code. Then I realized that it now does exactly the same as the answers from histocrat, matsjoyce and Peter Taylor... – Dennis – 2014-09-10T14:06:26.020