• 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.

• 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? Commented Jul 27, 2017 at 16:56
• Do we need to use all the bytes in our set? I would guess yes but it should probably be specified in the challenge. Commented Jul 27, 2017 at 17:06
• @Shaggy generally no, you can includes others for red herrings, but robbers can use everything Commented Jul 27, 2017 at 17:08
• Can robbers use the same byte twice or more? Commented Jul 27, 2017 at 17:19
• @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. Commented Jul 27, 2017 at 23:47

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. JavaScript (ES6), 10 bytes, A000007 Byte set: -)$>yRa=A(

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

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

• Can you link an online interpreter? I can't seem to find one Commented Jul 28, 2017 at 17:29
• @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. Commented Jul 28, 2017 at 17:32
• Gotcha. Only took about a minute of bruteforcing on my laptop!
– lynn
Commented Jul 28, 2017 at 17:41
• @Lynn Nice job! I knew I should have gone with a more complex series :P Commented Jul 28, 2017 at 17:41
• @Lynn Care to try a harder one? Commented Jul 28, 2017 at 19:08

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 • Commented Jul 28, 2017 at 12:19 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. • cracked Commented Jul 30, 2017 at 22:35 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. • Cracked Commented Jul 30, 2017 at 17:02 • @ChristianSievers - Great work! – user15259 Commented Jul 31, 2017 at 11:57 • 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. Commented Jul 31, 2017 at 12:54 • Thanks for that! Have reordered the parameters and revised the spoiler. – user15259 Commented Jul 31, 2017 at 13:46 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.

• Why the downvote? Dennis did a similar thing. Commented Aug 1, 2017 at 13:42
• 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"? Commented Aug 2, 2017 at 3:25
• @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.) Commented Aug 2, 2017 at 11:35
• cracked verbosely. Sorry, I posted this on the wrong cop answer previously. Commented Aug 4, 2017 at 16:14

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.

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 '!'.

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

Byteset:

@ABDEHIPabdehip


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.

Dh@I@P@pAB@d@pDPb@PDh@P@d@aDh@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 'Dh@I@P@pAB@d@pDPb@PDh@P@d@aDh@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.

My answer on Print X without X

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.

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!

[]()+!

• @L3viathan Close enough. :) I'd actually used $=>Math.pow(2,$)`, but you had the right idea. JavaScript is weird. Commented Aug 7, 2017 at 18:48