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.
_
, fyi \$\endgroup\$a(1000)
? (which is part of the sequence, but too large to be searchable on OEIS) \$\endgroup\$