23
1
This is a Cops and Robbers challenge. This is the robber's thread. The cop's thread is here.
The cops will pick any sequence from the OEIS, and write a program p that prints the first integer from that sequence. They will also find some string s. If you insert s somewhere into p, this program must print the second integer from the sequence. If you insert s + s into the same location in p, this program must print the third integer from the sequence. s + s + s in the same location will print the fourth, and so on and so forth. Here's an example:
Python 3, sequence A000027
print(1)
The hidden string is two bytes.
The string is +1
, because the program print(1+1)
will print the second integer in A000027, the program print(1+1+1)
will print the third integer, etc.
Cops must reveal the sequence, the original program p, and the length of the hidden string s. Robbers crack a submission by finding any string up to that length and the location to insert it to create the sequence. The string does not need to match the intended solution to be a valid crack, nor does the location it's inserted at.
If you crack one of the cops answers, post your solution (with the hidden string and location revealed) and a link to the answer. Then comment on the cops answer with a link to your crack here.
Rules
Your solution must work for any number in the sequence, or at least until a reasonable limit where it fails due to memory restrictions, integer/stack overflow, etc.
The winning robber is the user who cracks the most submissions, with the tiebreaker being who reached that number of cracks first.
The winning cop is the cop with the shortest string s that isn't cracked. Tiebreaker is the shortest p. If there are no uncracked submissions, the cop who had a solution uncracked for longest wins.
To be declared safe, your solution must stay uncracked for 1 week and then have the hidden string (and location to insert it) revealed.
s may not be nested, it must concatenated end to end. For example, if s was
10
, each iteration would go10, 1010, 101010, 10101010...
rather than10, 1100, 111000, 11110000...
All cryptographic solutions (for example, checking the hash of the substring) are banned.
If s contains any non-ASCII characters, you must also specify the encoding being used.
3You got it! That's the solution I was thinking of. I find it interesting that it works given that
%
left-associates. – xnor – 2019-07-11T22:00:58.673Yup, but a format string is a string, and "1%s0"%"1%s0" is "11%s00" which still does the thing we wanted to happen. – hobbs – 2019-07-12T14:38:49.680