5
For each integer n, 0 or higher, output the lowest power of 2 that has two identical sub-strings of n digits in decimal, and the two indices where the digit sub-strings start (0-based).
n Output Proof (don't output this)
0 => 0 [0 1] (_1 & 1_)
1 => 16 [0 4] (65536 & 65536)
1 => 16 [1 2] (65536 & 65536)
2 => 24 [0 6] (16777216 & 16777216)
2 => 24 [2 3] (16777216 & 16777216)
The possible outputs for the first three inputs are given above. When there is more than one output for a given input, either is acceptable. Only the digit positions will be different. Just output the numbers, the brackets are for clarity only. You don't need to output n.
Output a list of as many as you can find in one minute, or your code runs out of resources, whichever comes first. Please include the output with your answer. If the list is huge, just restrict it to the first and last 5. Your code must be able to find up to n = 9 in under a minute. I've written a Perl program that finds n = 9 after about 20 seconds, so this should be easy to do.
Your code doesn't need to halt itself. It is acceptable if you manually break out if it after a minute.
This is code-golf, so lowest number of bytes wins!
I don't get it, should we output only the lowest power of 2, or as many as we can find in one minute? – Katenkyo – 2016-02-16T08:26:11.630
@CJDennis Should we time it ourself (and halt it) or we can just let it run? – Katenkyo – 2016-02-16T08:33:07.050
3It's not clear if this challenge is a code-golf or [tag:fastest-code]. If you want to keep the primary winning criterion as code-golf, you might want to make a certain speed goal a validity criterion instead (e.g. must return an answer for n = 10 in less than one minute). – primo – 2016-02-16T11:48:57.577