Busy Beavers are programs (specifically Turing Machine programs) that aim to output the most ones as possible, while having the least states as possible and halting.


Your challenge is to make a busy beaver, which outputs as many ones as possible, but also outputs a second busy beaver. That second busy beaver must be executable in the same language as the original program, and can be no more bytes than the program that produced it

So, for example, say my program was a. That program should aim to print as many 1s as possible, and also output another program, say b, which also aims to print as many 1s as possible and outputs another program etc etc etc. b must be no more bytes than a

The program should be printed after the 1s, separated by any reasonable delimiter.

The outputted programs must also not be the same as any of the previous programs. When no more programs are generated, the scores are calculated from there. For example, program a can print b can print c can print d, but d doesn't print any other program. The scores would be calculated as (a_ones + b_ones + c_ones + d_ones) / (a_bytes + b_bytes + c_bytes + d_bytes) (see below)

The programs must also never error. The "programs" can also be functions, as long as they execute with no arguments


Your submission's score is the sum of the number of ones outputted by your programs, all divided by the sum of the bytes of the programs. The higher the score, the better.


closed as too broad by Luis felipe De jesus Munoz, xnor, Sriotchilism O'Zaic, mbomb007, Bubbler Nov 16 '18 at 5:13

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ Is f=_=>1 and f=_=>2 different programs? \$\endgroup\$ – Luis felipe De jesus Munoz Nov 15 '18 at 20:10
  • 3
    \$\begingroup\$ At some point down the rabbit hole, the programs will no longer be able to output new programs different from but no bigger than the previous ones, by the pigeonhole principle. So not all of your requirements can be satisfied at once! \$\endgroup\$ – Misha Lavrov Nov 15 '18 at 20:11
  • \$\begingroup\$ @LuisfelipeDejesusMunoz Yes \$\endgroup\$ – FireCubez Nov 15 '18 at 20:33
  • 4
    \$\begingroup\$ With the current rules, it seems likely that the way to maximize the score is to just print lots of ones, without printing a second program. \$\endgroup\$ – Misha Lavrov Nov 15 '18 at 20:47
  • 3
    \$\begingroup\$ There should probably be a restriction on how long a program could be, since the effect of dividing by the bytecount will be negligible for better busy beavers \$\endgroup\$ – Jo King Nov 15 '18 at 22:46

C (gcc), 71 bytes

I've not done one of these before but here's a shot at it;

Each program should print 4,294,967,295 ones, divided by the sum of bytes 71+30 scores 85,048,857


Try it online!

  • \$\begingroup\$ How many 1s is this supposed to print? \$\endgroup\$ – FireCubez Nov 15 '18 at 20:35

JavaScript (Node.js), 50 bytes


Try it online!

  • \$\begingroup\$ It seems like you want something more like (f=_=>[...Array(_)].map(a=>1).join``+`\n(f=${f})(${_-1})`)(1e3); otherwise, the output after all the 1s doesn't look like a working program to me. Also, I'm not sure where the factorial in your score is coming from. \$\endgroup\$ – Misha Lavrov Nov 15 '18 at 20:31
  • \$\begingroup\$ 1000! would be approximately 4.023872600770938*10^2567. None of your programs output that many ones. \$\endgroup\$ – Misha Lavrov Nov 15 '18 at 20:33
  • \$\begingroup\$ Using && will evaluate the previous numbers as true and will excecute the next line of code that is going to be the same program but with a different number (IDK if this fits into the rules since is not the same program at all) \$\endgroup\$ – Luis felipe De jesus Munoz Nov 15 '18 at 20:34
  • \$\begingroup\$ Lol @MishaLavrov my bad, I'm pretty bad at math Dx \$\endgroup\$ – Luis felipe De jesus Munoz Nov 15 '18 at 20:35
  • 1
    \$\begingroup\$ Changing 1e3 to 1e9 will give you a lot more 1s! \$\endgroup\$ – Shaggy Nov 15 '18 at 20:35

brainfuck, 99 bytes, \$f_{255}(255^2)\$


Assumes a wrapping implementation with an infinite tape in both directions.

This is modified from my Largest Number Printable to print 1s instead of 3s.


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