33
\$\begingroup\$

Robber's thread

Your task as cops is to select three things:

  • A programming language

  • An OEIS sequence

  • A byte set

You are then to secretly write a program in that language that computes the nth term sequence using only the bytes in the set. You will reveal the three pieces of information so that robbers can try to figure out the program.

Answers will be scored by the number of bytes in the byte set with more score being good. Cracked answers have an automatic score of 0. If your answer is uncracked after one week you may reveal the intended program and mark your answer as "safe".

Answers must be capable of calculating every term in the b-files of the sequence, but are not required to calculate any terms after.

Sequences can be either 1 or 0 indexed for both cops and robbers.

Here is a Python Script that checks if your code matches the given byte set.

\$\endgroup\$
16
  • 1
    \$\begingroup\$ Lower score is better? Or higher? So in essence we're trying to find a restricted character set that makes it difficult for someone else to make a program in the chosen language, after we've already worked out a solution? \$\endgroup\$
    – BradC
    Commented Jul 27, 2017 at 16:56
  • 1
    \$\begingroup\$ Do we need to use all the bytes in our set? I would guess yes but it should probably be specified in the challenge. \$\endgroup\$
    – Shaggy
    Commented Jul 27, 2017 at 17:06
  • 1
    \$\begingroup\$ @Shaggy generally no, you can includes others for red herrings, but robbers can use everything \$\endgroup\$
    – Stephen
    Commented Jul 27, 2017 at 17:08
  • 1
    \$\begingroup\$ Can robbers use the same byte twice or more? \$\endgroup\$
    – Mr. Xcoder
    Commented Jul 27, 2017 at 17:19
  • 2
    \$\begingroup\$ @Azulflame The b-files are files that are associated with each sequence the can be accessed by replacing the A with a b and appending a .txt. For example oeis.org/b4.txt would access the b-files for that sequence. \$\endgroup\$
    – Wheat Wizard
    Commented Jul 27, 2017 at 23:47

72 Answers 72

1 2
3
0
\$\begingroup\$

MATL, 11 bytes, A000984

Uses some of these bytes (ASCII):

$&)+/:HZdep

Due to floating-point precision, results are only guaranteed to be accurate up to the 26-th term. I hope that's acceptable.

\$\endgroup\$
0
0
\$\begingroup\$

JavaScript (ES6), 10 bytes, A000007

Byte set: -)$>yRa=A(

\$\endgroup\$
3
  • \$\begingroup\$ OEIS is currently down, so for anyone looking, A000007 is a(n)=0^n, which is 1,0,0,0,0,0,0,0,.... \$\endgroup\$
    – Birjolaxew
    Commented Jul 28, 2017 at 11:08
  • \$\begingroup\$ Cracked! \$\endgroup\$
    – user41805
    Commented Jul 28, 2017 at 11:15
  • \$\begingroup\$ Cracked with 6 bytes \$\endgroup\$
    – Birjolaxew
    Commented Jul 28, 2017 at 11:16
0
\$\begingroup\$

Seed, A000027 (Counting Numbers) (Cracked)

You may use any valid character in Seed:

[0-9 ]

Have fun! The resulting Befunge program is short, so you should definitely be able to brute force it within a week (if you're crazy enough to do that).

My Solution:

My solution is a little bit longer than Lynn's solution...

4 47142938850356537668025719950342285215695875470457212766920093958965599014291682211474803930206233718243166021324700185443274842742744297183042397910454208210130742260519105651032450664856693714718759816232968955289663444878636053035645231246428917992493766505872029989544065894418166685284738859999912471659057565000392419689361271972485444731284404987238803115210428572945108908191097214978382112218242627719651728712577306652405452922782307249485947045215982784790396555726144526602778473387279897334709142853151393812930171163300904436548870603006549005515709074682843356844201220668045057407146751793470423217099467145255174198241606814578351260769359571053755888106818197239116973006365593563235361647743411341624822052103816968153274122434280200888824954875622811325064255818154979564925710534165572852442761249176778416688044630942040966271963723430245979221181930857841829694362184653939393940015797332978459794253176110314873994228261888801228999293570329618551223457182420746927212801550646743152754821640064626761542582557138452651970009253770914346130172884305622027370793496993281847017017643506435562229916984107083951938286577012273222191422054315198157936674247934699496471202544270325061352014830137178245082445717253260177560449757186762445707057028987371278573629077370632470496186218574320801798046510846708620502139560277546345198686675095078255875594169064796673074708822106659920187882062247609587560174781170641367430722951002242213604709887062481149928551745163110045572994991844223216663621203042075294195007458339984527333125093390189721042315604498435269143549420166732177200370228527273606218617171975362431824163269672003982537382982066136613799403024924018145511099557720492305303748099327810811511080314262364010281851651151072957475365629128068033597559560186625877942054704386175359499573139930378099420149452745731809033737756051947913924265484582800618244473333957173960222243311738522875022546610298627492222587971756897328087719407454153248557203886421828643453889090192355970705084245312184441674098515659253482621260617211786550204852895652236768886852209506535523414991099331857674826373947830587028494510697603296607361093480842935154672353288419699354739650168309017848485131553416956405911683526896232046773861961911767319373432460217755874481607587604361758089936007730253450733375831228127106295259261723611771334468553746160739548375950046831923765023329346333968732796413192682936767133122325481273354810124729664400173367781325488656859581438769940474229394692089519981810909719628263357284973442177568041416363386891516725592952892168077523560584005586276794967492051823290615767599202657060820223928678900774601616908031321346819422162123048834532926372862962159255934240435694566497798544870186550219886342379298214007368081326725550763589917206162393892085506551547475259270513853987294911388226039365971184089828739349642347312302559286882065147953715607221387657413593069535573044067517274676745306396611760657091792151803798859781616126637075577936361782593546481811651450365118155866449850474140044293772144065341051900055416408240857348697564252386403719942197789892382627153382011984996644288495699209129097948405810551134169739499539470610790009272281731894550593600643079188663110695127017324336488487580799309995227054576681630676222848231145106058050452439356753552872060820230589152143268436210090733908507724084889788244157692417246691477400856716677564609725979550100138132944851304473466485128295568194188600539248624248078558656162635444219199062786468487219220160009464328883337821175254405764395407405891483810757405446047244460754827113527540703326714751461178900155717130399854320238635234164429884664271159504714368008455653061601459723385727262777232764564573673873772208222457183846136405752956618693937985108892893985455752900109747276359722218661153262749015305405756329658744441481575547254529963547290233424398012124166511178581644295375904189900373061373853471489496222876806462541916199940534855562482928962080779491332702863921351256172643450743469939804784306286205587292552998145733381435925702081855362374409244827640579395543246453123597643190692540938806013686596772963034314363354010871521973403725835700408947963387110274004628480425371734331910891935140460595015189156420163115488068088520486798706569490006916112796733633895122682258059129006594304004203161927532260544237735899697152969940248758172957772287759336801595261613720119580891726456931895143417855893848415813470404827691913198395587019754512910027895295524122640301750273229263700158423422494600783294301471077720755163088097928474808200825811331834384330131090616226795924514158947235407965623454021092089105236025774499670509312408897668570458845620423145441557589436789713088947243846896823513743795131462439985465454654508125778329519910755888052092925306512948187971238329609568930378458165199920437525216462470929107070404811453630873763646812061350580161443056020563505260186672704841049972564837245044063297483792279875783885332694312955039151703943626840229495942158368887321883672956326501715270278543111513846830331160757034936022626603927067201550075630055296060821698451711220226998542584472966056248420845670285305975196992649811350779376980410458954534606441616709943508562093877902996409050522302853982991210150961788557227893313889825011281746787557452112185337922107257901043776646541934164147921577497411930472664026894384833716916001510862714001082105916461354489145794983975342462583664139916994875750562786683033654066234795041967161156949148282294752956521537053912878502375506909313842856133697079387338725355753694963250928996068864246591064004864326952187480597051907196284596345012237848475736570739686898404311769576575237233438553293161482584973742517010294566986396986963333792493710800886286588229647009335037917560300340277732774595016553407284174237194411762775063365955286488230300605484062176178336345135677894004813511507360069468591733327248913533084977745451497662084575239380871947004076480854627777980299105041121280
\$\endgroup\$
5
  • \$\begingroup\$ Can you link an online interpreter? I can't seem to find one \$\endgroup\$
    – Azulflame
    Commented Jul 28, 2017 at 17:29
  • \$\begingroup\$ @Azulflame There's no interpreter because the language is converted to Befunge before being interpreted. Use the python script provided on esolangs.org and TIO's Befunge-98 interpreter. \$\endgroup\$
    – TehPers
    Commented Jul 28, 2017 at 17:32
  • \$\begingroup\$ Gotcha. Only took about a minute of bruteforcing on my laptop! \$\endgroup\$
    – lynn
    Commented Jul 28, 2017 at 17:41
  • \$\begingroup\$ @Lynn Nice job! I knew I should have gone with a more complex series :P \$\endgroup\$
    – TehPers
    Commented Jul 28, 2017 at 17:41
  • \$\begingroup\$ @Lynn Care to try a harder one? \$\endgroup\$
    – TehPers
    Commented Jul 28, 2017 at 19:08
0
\$\begingroup\$

Ruby, A000217, 15 bytes, Cracked

Uses the -p flag to take input from stdin and output to stdout.

$mu.to_vim[d=s]

Intended solution:

$_=[$...$_.to_i][$..div$$].sum

\$\endgroup\$
1
  • \$\begingroup\$ Cracked. \$\endgroup\$
    – Doorknob
    Commented Jul 28, 2017 at 12:19
0
\$\begingroup\$

Haskell, A001107 (cracked)

This one is easier, the sequence is growing slower and the charset is smaller.

Compute the decagonal numbers n(4n-3) using the following charset of size 9:

.,_-=[ ]!

Again there is no newline.

\$\endgroup\$
1
  • \$\begingroup\$ cracked \$\endgroup\$
    – Laikoni
    Commented Jul 30, 2017 at 22:35
0
\$\begingroup\$

C, A000312 (cracked)

-,;:?(){} eglnortu

The specs call for a complete program, however this would add many more characters to the byte set making the challenge trivial. Instead, you’ll be providing the code within this template:

«your-code-composed-of-characters-in-byte-set»

#include <stdlib.h>
#include <stdio.h>

int main(int argc, char** argv)
{
    int n = argc > 1? atoi(argv[1]): 0;
    printf("%d ^ %d = %lld\n", n, n, «your-function-name»(n));
    return 0;
}

Note that your code comes before the #includes.

Answer: long long l(long long o,long long n){return o- -n;} long long o(long long n,long long g){return g?(--g?l(o(n,g),n):n):g;} long long n(long long g,long long l){return l?o(n(g,--l),g):- --l;} long long g(long long l){return n(l,l);} Addition l is expressed as subtraction of a negated value m + n = m − (−n), multiplication o as a series of additions m × n = m × (n − 1) + m, exponentiation n as a series of multiplications mⁿ = mⁿ⁻¹ × m, and finally the function g which calls the exponentiation function. On machines where long long is 64 bits wide, this code will give incorrect answers for n ≥ 16, but note there are machines out there with word lengths of more than 64 bits, e.g. the Ethereum Virtual Machine (EVM) with 256-bit words where long long could naturally accommodate values ≫ 2⁶⁴. So in theory the code would work for n ≥ 16.

\$\endgroup\$
4
  • \$\begingroup\$ Cracked \$\endgroup\$ Commented Jul 30, 2017 at 17:02
  • \$\begingroup\$ @ChristianSievers - Great work! \$\endgroup\$
    – user15259
    Commented Jul 31, 2017 at 11:57
  • \$\begingroup\$ Your code has an unlucky combination of o recursing on the second argument, and n calling o in a way such that the second argument is potentially much bigger than the first. If you avoid this, you will see your numbers overflowing long before your stack does. \$\endgroup\$ Commented Jul 31, 2017 at 12:54
  • \$\begingroup\$ Thanks for that! Have reordered the parameters and revised the spoiler. \$\endgroup\$
    – user15259
    Commented Jul 31, 2017 at 13:46
0
\$\begingroup\$

CPython 3.6.2, A000720 (cracked)

I have decided to squeeze as many characters out of Latin-1 as possible without simplifying the challenge. There are some unprintables, so I will provide the characters in the following format:

print(",".join((
    "0x0-0x8",
    "0xa-0x1f",  #inc. \n
    "0x23-0x24",  # chars #$
    "0x28-0x29",  # chars ()
    "0x2c",  # char ,
    "0x2e",  # char .
    "0x3b",  # char ;
    "0x3d",  # char =
    "0x3f",  # char ?
    "0x41-0x5d",  # A-Z and chars [\]
    "0x5f",  # char _
    "0x62-0x64", # chars bcd
    "0x69",  # char i
    "0x6c",  # char l
    "0x6e",  # char n
    "0x73-0x75", # chars stu
    "0x7f-0xff"
)))

I think that makes 208 characters. Feel free to use any of these.

I did not hard-code; that would take so many characters I would have to start meta-meta-programming. This set of characters is provably Turing-complete.

\$\endgroup\$
4
  • \$\begingroup\$ Why the downvote? Dennis did a similar thing. \$\endgroup\$
    – wizzwizz4
    Commented Aug 1, 2017 at 13:42
  • \$\begingroup\$ I wasn't the downvoter, and I don't think this is why the downvote, but couldn't you just say "I used 0x0-0x8,0xa-0x1f,0x23-0x24,0x28-0x29,0x2c,0x2e,0x3b,0x3d,0x3f,0x41-0x5d,0x5f,0x62-0x64,0x69,0x6c,0x6e,0x73-0x75,0x7f-0xff"? \$\endgroup\$
    – MD XF
    Commented Aug 2, 2017 at 3:25
  • \$\begingroup\$ @MDXF I could, but then there wouldn't be the comments explaining what the characters were and people would have to manually look things up or write a program to get the printable characters out of it. (I admit that my "format" isn't the best, though.) \$\endgroup\$
    – wizzwizz4
    Commented Aug 2, 2017 at 11:35
  • \$\begingroup\$ cracked verbosely. Sorry, I posted this on the wrong cop answer previously. \$\endgroup\$ Commented Aug 4, 2017 at 16:14
0
\$\begingroup\$

Python 2, A005150 (Look and say), safe

 "()+,.01:=ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]_celnortwx

Gee, you don't didn't have much, do did you?

Intended solution:

exec("FROM ITERTOOLS IMPORT GROUPBY\nA=\"1\"\nFOR _ IN RANGE(1,INT(INPUT())):\n\tA=[\"\".JOIN(GRP)FOR M,GRP IN GROUPBY(A)]\n\tA=\"\".JOIN([STR(LEN(X))+X[0]FOR X IN A])\nPRINT(A)".lower()) You have all of the uppercase characters, and just enough lowercase ones for \n, \t, exec and lower.

\$\endgroup\$
0
\$\begingroup\$

Perl 5 -p, A005843, score:16, safe.

 .0123456789aelv

A simple problem. You should solve this easily if you are familiar with the language well.

Intended solution

eval 36.95.42.61.50 How it works: version number such as 5.10.3 is represented as a string. So, you just need to construct a version number to be evaluated. Example: v33 is '!'.

\$\endgroup\$
0
\$\begingroup\$

CLC-INTERCAL 1.-94.-2, A001477, safe, score: 16.

Byteset:

@ABDEHIP`abdehip

You may use any i/o method. Also you may use any compiler option.

Try it online! Submitting as CLC-INTRCAL does not let you set compiler option, so you might need to try as shell.

The answer

D`h@I@`P@pAB@d@p`DPb@PD`h@`P@d@aD`h@E@ABPb@P

This is equivalent to DOWRITEIN.1DOREADOUT.1 in Hollerith character set; so input range is OH or ZERO to SIX FIVE FIVE THREE FIVE (inclusive).

Try the following Bash script online:

printf 'D`h@I@`P@pAB@d@p`DPb@PD`h@`P@d@aD`h@E@ABPb@P'>.i;sick -h .i;./.io

How it works

The code can be in Hollerith character set. However, it is implemented incorrectly so the code above is for such behaviour as in implementation, not for documentation.

Here is the script to accept punch lines to generate a program in Hollerith.

Also why doesn't the compiler guess anything other than ASCII? So I had to force it to use my intended character code, by -h.

See also

My answer on Print X without X

\$\endgroup\$
0
\$\begingroup\$

CLC-INTERCAL, A001477, safe, score: 14.

Byteset:

ACFGIJLPRWX[\_

Rules

  • You may use any compiler option.
  • You may specify i/o format by yourself.
  • You may specify range of input.
  • You may specify whether 0-indexed or 1-indexed.
  • I made a program that works on this online environment.

Answer

IXRJFPAFL[\W_IXJACIXGP[\W

This is DOWRITEIN.1DOREADOUT.1 in Baudot encoding, so input range is OH or ZERO to SIX FIVE FIVE THREE FIVE. Due to the encoding, you need compiler option -b if it is newer so the character guessing does not work.

Try the following Bash script in online environment

printf %s 'IXRJFPAFL[\W_IXJACIXGP[\W'>.i
sick -b .i
./.io<<<'THREE FOUR FIVE'

Copy and paste to try it online!

See also

\$\endgroup\$
-5
\$\begingroup\$

Javascript (ES6), A000079, 6 Bytes

[]()+!

Hint:

Intended solution is 25496 characters long.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$
    – L3viathan
    Commented Aug 7, 2017 at 14:43
  • \$\begingroup\$ @L3viathan Close enough. :) I'd actually used $=>Math.pow(2,$), but you had the right idea. JavaScript is weird. \$\endgroup\$ Commented Aug 7, 2017 at 18:48
1 2
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.