7
\$\begingroup\$

This challenge is for the largest finite number you can get BrainFuck programs of given lengths to contain in memory.

We must use one of the BF versions that uses big integers for the cells rather than byte values as not to be capped at 255. Do not use negative positions and values in memory. Do not use the BF instruction to input memory, also the output instruction is not needed.


Challenge:

Write Brainfuck programs with lengths from 0 to 50. Your score is the sum of each programs maximum value in memory.


As they may well be trivial feel free to omit the programs listed below and start from a length of 21, I'll use the following for the smaller sizes:

Length, Score, Program

0, 0
1, 1, +
2, 2, ++
3, 3, +++
Pattern Continues
10, 10, ++++++++++
11, 11, +++++++++++
12, 12, ++++++++++++
13, 16, ++++[->++++<]
14, 20, +++++[->++++<]
15, 25, +++++[->+++++<]
16, 30, ++++++[->+++++<]
17, 36, ++++++[->++++++<]
18, 42, +++++++[->++++++<]
19, 49, +++++++[->+++++++<]
20, 56, ++++++++[->+++++++<]

Total Score: 352


Related but different:

Large Numbers in BF

Largest Number Printable

Busy Brain Beaver

See the comments below for more info.



The combined results so far, being the sum of the best of each size:

length: 50
by l4m2

(262) - 2


length: 49
by l4m2

(212) - 2


length: 48
based on code by l4m2, by alan2here

(172) - 2


length: 39 to 47
based on code by l4m2, by alan2here

Σ (n = 4 to 12) of (fn(0) | f(x) := (4x+2 - 4) / 3)


length: 38
based on code by l4m2, by alan2here

(4^1366 - 4) / 3


length: up to 37 by alan2here

x |
  x > 6 ^ 20
  x > n
  x ≈ n
  n = 3,657,880,038,459,860
\$\endgroup\$
  • 2
    \$\begingroup\$ How is this challenge different from Large Numbers in BF ? \$\endgroup\$ – TFeld Nov 15 '18 at 15:22
  • 4
    \$\begingroup\$ The other question says cells which can take on any integer value without overflowing, though it's impossible to actually get above 255 anyway. This extension seems like a more interesting question (that bans negative positions as well. I don't think eiher should be closed \$\endgroup\$ – Jo King Nov 15 '18 at 22:22
  • 3
    \$\begingroup\$ There's a close connection between true busy beavers (counting execution time) and largest value computers. Clearly calculating a large value by incrementation implies a long execution, but also a long execution implies the possibility of counting the steps to get a large number. Perhaps the closest previous question is in fact codegolf.stackexchange.com/q/4813/194 . \$\endgroup\$ – Peter Taylor Nov 16 '18 at 23:04
  • 1
    \$\begingroup\$ Unfortunately, only the last program really counts for anything with the bigger busy beavers, as there's no point adding the smaller programs to the total. It gets to the ppint where the number is so large that doubling or tripling it doesn't really matter \$\endgroup\$ – Jo King Nov 21 '18 at 13:59
  • 1
    \$\begingroup\$ Indeed, I wouldn't be surprised if that were the case. \$\endgroup\$ – lirtosiast Nov 26 '18 at 20:53
5
\$\begingroup\$

(262)-2

+++++[->+++++<]>[->+[->+[->++<]>[-<+>]<<]<[->+<]>]

Where (42) = 2222

f20(0), where f(x):=(4x+2-4)/3

++++[->+++++<]>[->+[->+[->++<]>[-<++>]<<]<[->+<]>]
\$\endgroup\$
  • \$\begingroup\$ It can of course be larger, but just hard to express then \$\endgroup\$ – l4m2 Nov 21 '18 at 15:36
  • \$\begingroup\$ Your function appears to take 2 parameters? f<sup>n</sup>(m) What happens with the 16 in the calculation? Is this the same as (4^18 - 4) / 3 = about 23 billion? \$\endgroup\$ – alan2here Nov 23 '18 at 9:41
  • 1
    \$\begingroup\$ @alan2here That means the result is fed into the function repeatedly, e.g. f(f(f(f(... 0)))) \$\endgroup\$ – Jo King Nov 23 '18 at 11:10
  • \$\begingroup\$ Thank you for the info. \$\endgroup\$ – alan2here Nov 23 '18 at 11:36
  • \$\begingroup\$ I think it's safe to assume that the 16 is generated by the 4*4 at the start of the code and credit you with a 5*4 version as well, what with the unnecessary last character, giving you best so far 49 and 50. :) \$\endgroup\$ – alan2here Nov 23 '18 at 12:32
1
\$\begingroup\$

total: ≈ 172 - 2

The most dominant one in this total is based on a design by l4m2.

lengths: 0 to 12
{0, 1, 2, … 11, 12}

"", +, ++, +++
Pattern Continues
+++++++++++
++++++++++++
+++++++++++++

total: 78

lengths: 13 to 24
N × N
(N + 1) × N
16, 20, 25, 30, 36, 42, 49, 56, 64, 72, 81, 90

++++[->++++<]
+++++[->++++<]
+++++[->+++++<]
Pattern Continues
+++++++++[->++++++++<]
+++++++++[->+++++++++<]
++++++++++[->+++++++++<]

total: 581

total so far: 659


each yeild: fn(0) | f(x) = x × m + 1

lengths: 25
(m, n) = (5, 4)
156
>+>+>+>+<[>[-<+++++>]<<]>

length: 26
(m, n) = (4, 5)
341
>+>+>+>+>+<[>[-<++++>]<<]>

total: 497

total so far: 1156


each yeild: fr or (r × s)(0) | f(x) = (x + 1) × (p × q)

length: 27
(p, q, r) = (2, 2, 5)
1364
+++++[->+[->++<]>[-<++>]<<]

length: 28
(p, q, r) = (2, 2, 6)
5460
++++++[->+[->++<]>[-<++>]<<]

length: 29
(p, q, r) = (2, 2, 7)
21,844
+++++++[->+[->++<]>[-<++>]<<]

length: 30
(p, q, r) = (2, 2, 8)
87,380
++++++++[->+[->++<]>[-<++>]<<]

total: 116,048

total so far: 117,204

length: 36
(p, q, r, s) = (2, 3, 4, 4)
(≈ & >) (6 ^ 16 = 1,721,598,279,680)
++++[->++++<]
[->+[->+++<]>[-<++>]<<]

length: 37
(p, q, r, s) = (2, 3, 4, 5)
(≈ & >) (6 ^ 20 = 3,656,158,440,062,976)
+++++[->++++<]
[->+[->+++<]>[-<++>]<<]

total: (≈ & >) 3,657,880,038,342,656

total so far: (≈ & >) 3,657,880,038,459,860


Based a design by l4m2

each yeild: fn(0) | f(x) = (4x + 2 - 4) / 3

length: 38
n = 4
+++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

length: 39
n = 4
++++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

length: 40
n = 5
+++++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

length: 41
n = 6
++++++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

length: 42
n = 7
+++++++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

length: 43
n = 8
++++++++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

length: 44
n = 9
+++++++++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

length: 45
n = 10
++++++++++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

length: 46
n = 11
+++++++++++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

length: 47
n = 12
++++++++++++[->+[->+[->++<]>[-<++>]<<]<[->+<]>]

Based a design by l4m2
length: 48
++++[->++++<]>[->+[->+[->++<]>[-<+>]<<]<[->+<]>]

total: 172 - 2



Honorary Mention
(3 × 3) ^ 4
>+<++++[->[->+++<]>[-<+++>]<<]
\$\endgroup\$
0
\$\begingroup\$

Revision!

Even bigger numbers now!

++++++++[>+>>++++++++[<<[>+++<-]>[<++++>-]>-]<<<-]

Result: 1.1684220603446423e+69 or 116842206034464220000000000000000000000000000000000000000000000000000 (At least that's what the compiler says)

How?

How this works is that repeats the assignment v=v(4*3)^v 8 times(At least that's what I intended it to do.

\$\endgroup\$
  • 1
    \$\begingroup\$ Testing this the function looks as if it grows impressively, what function is it? Maybe you can win at one of the other sizes. \$\endgroup\$ – alan2here Nov 29 '18 at 18:36

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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