39
7
This is the cops' thread. The robbers' thread goes here.
The last cops-and-robbers thread was already 4 months ago.
The cop's task
- The cop's task is to write a program/function that takes a positive (or non-negative) integer and outputs/returns another integer.
- The cop must state it if the program is intolerant towards zero.
- The cop will provide at least 2 sample inputs/outputs.
- For example, if I have decided to write the Fibonacci sequence, I would write this in my answer:
a(0) returns 0 a(3) returns 2
- The number of examples is up to the cop's discretion.
- However, the sequence must actually exist in the On-Line Encyclopedia of Integer Sequences®, so no pseudo-random number generator for you.
:(
- The cop can hide as many characters as is so wished.
- For example, if my program is:
function a(n)
if n>2 then
return n
else
return a(n-1) + a(n-2)
end
end
- Then I would hide these characters as I want:
function a(n)
if ### then
########
else
######################
end
end
The robber's task
- is obviously to find the original source code.
- However, any proposed source code that produces the same set of output also counts as valid, as long as it is also found in OEIS.
Tips for the cops
The search function in the OEIS only works for consecutive terms, so if you want to hide your sequence, then just leave a hole anywhere.- Apparently there is no way to hide the sequence. Put this in mind when you choose the sequence.
Your score is the number of bytes in your code.
The winner will be the submission with the lowest score that hasn't been cracked in 7 days.
Only submissions that are posted in 2016 April are eligible for the win. Submissions that are posted later than this are welcome, but cannot win.
In order to claim the win you need to reveal the full code and the OEIS sequence (after 7 days).
Your post should be formatted like this (NN is the number of characters):
Lua, 98 bytes
Output:
a(0) returns 0
a(3) returns 2
Code (#
marks unrevealed characters):
function a(n)
if ### then
########
else
######################
end
end
If the code is cracked, insert [Cracked](link to cracker)
in the header.
If the submission is safe, insert "Safe" in the header and reveal the full code in your answer. Only answers that have revealed the full code will be eligible for the win.
Just to clarify: if I post a cop which specifies
a(0) = 1, a(1)= 1
with the Fibonacci sequence in mind, and a robber posts a crack which outputs the constant1
sequence (i.e. not what I had in mind), then does this count as cracked? – Sp3000 – 2016-04-09T00:59:03.6232Also, OEIS search can have blanks with
_
, fyi – Sp3000 – 2016-04-09T00:59:14.110Also "the parts of the code not related to the number generation must be revealed" seems a bit confusing to me. Suppose I posted an answer in Brainfuck - which parts would that be? – Sp3000 – 2016-04-09T01:01:03.307
1In your example you choose to reveal the spaces. Does that mean that you could just add as many spaces as you need in your submission to not reveal anything important? – user81655 – 2016-04-09T01:06:52.793
@Sp3000 Re "OEIS search can have blanks": Then how would I hide the sequence? – Leaky Nun – 2016-04-09T01:07:17.957
1@user81655 Yes, but that would count towards the byte count. – Leaky Nun – 2016-04-09T01:07:31.193
@Sp3000 Re "a robber posts a crack which outputs the constant 1 sequence": "However, any proposed source code that produces the same set of output also counts as valid (you are encouraged to reproduce an actual sequence in the OEIS)." – Leaky Nun – 2016-04-09T01:08:13.660
@Sp3000 Re "
a(0) = 1, a(1)= 1
with the Fibonacci sequence in mind":a(0)=0
. – Leaky Nun – 2016-04-09T01:10:22.490So if I have, say, 31 characters, do I have to show six or seven of them? – Fund Monica's Lawsuit – 2016-04-09T02:19:10.890
9It may be too late to change, but allowing sequences that are multiples of an OEIS sequence, and/or only include every nth term would have made this challenge much better. sandbox, hint, hint – Nathan Merrill – 2016-04-09T02:37:57.540
I don't think that is necessary. – Leaky Nun – 2016-04-09T03:20:59.397
6Can I, for example, pick the Fibonacci sequence and provide only
a(1000)
? (which is part of the sequence, but too large to be searchable on OEIS) – Sp3000 – 2016-04-09T06:36:06.6172I'd say the values have to actually be searchable on OEIS, so that it can easily be verified that the values are correct for the chosen sequence. – Mego – 2016-04-09T06:38:59.647
3"Intolerant towards zero" makes no sense. What is that supposed to mean? – feersum – 2016-04-10T23:28:12.387
@feersum I would believe it means whether or not the program outputs the sequence starting with 0 or 1, but I'd also like clarification. – Mego – 2016-04-11T01:37:13.303
1In your example program I think you meant
n<2
– Cyoce – 2016-04-11T05:03:57.183Can cops post more than one answer? – ASCIIThenANSI – 2016-04-11T21:06:16.013
I don't understand... What is a "Safe" answer ? – FliiFe – 2016-04-16T16:11:14.660
@FliiFe An answer that doesn't get cracked in a week. – Leaky Nun – 2016-04-16T16:14:25.677
@KennyLau After a week, an answer cannot be cracked anymore, can it ? – FliiFe – 2016-04-16T16:18:30.990
Nope, it cannot. – Leaky Nun – 2016-04-16T16:19:30.483