12
2
This is a cops-and-robbers challenge. The Cops' thread to this challenge is here
An interesting question to think about is the following:
If I have a sequence of numbers how many of them do I have to provide before it is clear what sequence I am talking about?
For example if I want to talk about the positive integers in order starting from \$1\$, I could say \$1,2,3, \dots\$, but is that really enough?
I have one way of answering this question, and being a code-golfer It involves code-golf. You have provided enough terms of a sequence if the shortest code that produces those terms produces all the terms of the sequence. If we think about this in terms of code-golf, this would mean you have provided enough test cases such that the shortest code that passes the test-cases does the desired task.
Challenge
This challenge is a cops-and-robbers challenge. In which cops will be presenting test-cases and robbers will have to find a shorter way to spoof the test-cases other than the intended sequence. Cops will present the following things:
A piece of code that takes a positive integer as input and produces an integer as output. This code can be either zero or one indexed but it should be clear what the indexing is. This code will define your sequence.
Any relevant platform or language requirements that might effect the output, for example the size of longint.
A number \$n\$, along with the first \$n\$ terms of the sequence as calculated by the code. These will act as "test-cases".
Robbers will be finding a program in the same language that is shorter than the one presented and passes all the test cases (produces the same output for the first \$n\$ inputs as the cop's code). The robber's code must also differ in output from the cop's program for some number larger than \$n\$.
Scoring
Robbers will be scored in the number of cracks they find with more cracks being better. An answer can be cracked again by finding a valid answer shorter than the original crack. If an answer is cracked a second time the point is given to the second cracker rather than the first.
2Are we not letting robbers beat each other for cracking an answer (ie shortest crack in the language winning) – fəˈnɛtɪk – 2018-06-29T15:52:46.390
@fəˈnɛtɪk Sounds, good I added that. – Post Rock Garf Hunter – 2018-06-29T16:06:03.943