7
Instead of normal binary, you must count from 1 to an input in negabinary concatenated to negaquaternary.
Here's an example, put in the form of an array:
[11, 1102, 1113, 100130, 101131, 11010132, 11011133, 11000120, 11001121, 11110122, 11111123, 11100110, 11101111, 10010112, 10011113, 10000100, 10001101, 10110102, 10111103, 10100230, 10101231, 1101010232, 1101011233, 1101000220, 1101001221, 1101110222, 1101111223, 1101100210, 1101101211, 1100010212, 1100011213, 1100000200, 1100001201, 1100110202, 1100111203, 1100100330, 1100101331, 1111010332, 1111011333, 1111000320, 1111001321, 1111110322, 1111111323, 1111100310, 1111101311, 1110010312, 1110011313, 1110000300, 1110001301, 1110110302, 1110111303, 111010013030, 111010113031, 100101013032, 100101113033, 100100013020, 100100113021, 100111013022, 100111113023, 100110013010, 100110113011, 100001013012, 100001113013, 100000013000, 100000113001, 100011013002, 100011113003, 100010013130, 100010113131, 101101013132, 101101113133, 101100013120, 101100113121, 101111013122, 101111113123, 101110013110, 101110113111, 101001013112, 101001113113, 101000013100, 101000113101, 101011013102, 101011113103, 101010013230, 101010113231, 11010101013232, 11010101113233, 11010100013220, 11010100113221, 11010111013222, 11010111113223, 11010110013210, 11010110113211, 11010001013212, 11010001113213, 11010000013200, 11010000113201, 11010011013202, 11010011113203, 11010010013330]
Your program must produce those numbers in any of these forms:
- spaced apart
- in an array
- on new lines
How do I get those numbers?
Integer n
will be used as an example of input.
for i := 1 to n print "i in base -2" + "i in base -4"
Rules:
- You can submit a function or a whole program
- You can go from 0 or 1 to the input
- Builtins are allowed
as per this meta ruling, you can define globals with the constants outside: http://meta.codegolf.stackexchange.com/questions/5532/when-submitting-a-function-can-global-variables-be-declared-outside-the-functio
– Maltysen – 2015-07-19T03:20:17.273@Maltysen: Oh nice, I had forgotten about that. Thanks! – Alex A. – 2015-07-19T03:27:38.370
I don't think you can define globals unless the function is named. – feersum – 2015-07-19T14:57:49.320
@feersum: Okay, no problem. Made them local at the cost of 2 bytes. – Alex A. – 2015-07-19T17:53:09.607