Largest Number Printable

Your goal is to write a program that prints a number. The bigger the number, the more points you'll get. But be careful! Code length is both limited and heavily weighted in the scoring function. Your printed number will be divided by the cube of the number of bytes you used for your solution.

So, let's say you printed 10000000 and your code is 100 bytes long. Your final score will be 10000000 / 100^3 = 10.

There are other rules to follow, in order to make this challenge a bit harder.

• You cannot use digits in your code (0123456789);
• You can use mathematical/physical/etc. constants, but only if they are less than 10. (e.g. You can use Pi ~= 3.14 but you can't use the Avogadro constant = 6e23)
• Recursion is allowed but the generated number needs to be finite (so infinite is not accepted as a solution. Your program needs to terminate correctly, assuming unbounded time and memory, and generate the requested output);
• You cannot use the operations * (multiply), / (divide), ^ (power) nor any other way to indicate them (e.g. 2 div 2 is not allowed);
• Your program can output more than one number, if you need it to do that. Only the highest one will count for scoring;
• However, you can concatenate strings: this means that any sequence of adjacent digits will be considered as a single number;
• Your code will be run as-is. This means that the end-user cannot edit any line of code, nor he can input a number or anything else;
• Maximum code length is 100 bytes.

1. Steven H., Pyth ≈ fφ(1,0,0)+7(25626)/1000000[1]
2. Simply Beautiful Art, Ruby ≈ fφ121(ω)(126)[1]
3. Peter Taylor, GolfScript ≈ fε0+ω+1(17)/1000 [1]
4. r.e.s., GolfScript ≈ fε0(fε0(fε0(fε0(fε0(fε0(fε0(fε0(fε0(126))))))))) [1]
5. Simply Beautiful Art, Ruby ≈ fωω2+1(1983)
6. eaglgenes101, Julia ≈ fω3(127)
7. col6y, Python 3, ≈ (127→126→...→2→1) / 993 [1][3]
8. Toeofdoom, Haskell,a20(1) / 993 [1]
9. Fraxtil, dc, ≈ 15 ↑¹⁶⁶⁶⁶⁶⁵ 15 / 1003 [3]
10. Magenta, Python, ≈ ack(126,126)/1003 ≈ 10 ↑124 129
11. Kendall Frey, ECMAScript 6, ≈ 10 3 ↑4 3 / 1003 [1]
12. Ilmari Karonen, GolfScript, ≈ 10 ↑3 10377 / 183 [1]
14. recursive, Python, ≈ 2↑↑11 / 953 ≈ 10↑↑8.63297 [1][3]
15. n.m., Haskell, ≈ 2↑↑7 / 1003 ≈ 10↑↑4.63297 [1]
16. David Yaw, C, ≈ 10104×1022 / 833 ≈ 10↑↑4.11821 [2]
17. primo, Perl, ≈ 10(12750684161!)5×227 / 1003 ≈ 10↑↑4.11369
18. Art, C, ≈ 10102 × 106 / 983 ≈ 10↑↑3.80587
19. Robert Sørlie, x86, ≈ 102219+32 / 1003 ≈ 10↑↑3.71585
20. Tobia, APL, ≈ 1010353 / 1003 ≈ 10↑↑3.40616
21. Darren Stone, C, ≈ 101097.61735 / 983 ≈ 10↑↑3.29875
22. ecksemmess, C, ≈ 102320 / 1003 ≈ 10↑↑3.29749
23. Adam Speight, vb.net, ≈ 105000×(264)4 / 1003 ≈ 10↑↑3.28039
24. Joshua, bash, ≈ 101015 / 863 ≈ 10↑↑3.07282

Footnotes

1. If every electron in the universe were a qubit, and every superposition thereof could be gainfully used to store information (which, as long as you don't actually need to know what's being stored is theoretically possible), this program requires more memory than could possibly exist, and therefore cannot be run - now, or at any conceiveable point in the future. If the author intended to print a value larger than ≈3↑↑3.28 all at once, this condition applies.
2. This program requires more memory than currently exists, but not so much that it couldn't theoretically be stored on a meager number of qubits, and therefore a computer may one day exist which could run this program.
3. All interpreters currently available issue a runtime error, or the program otherwise fails to execute as the author intended.
4. Running this program will cause irreparable damage to your system.

Edit @primo: I've updated a portion of the scoreboard using a hopefully easier to compare notation, with decimals to denote the logarithmic distance to the next higher power. For example 10↑↑2.5 = 1010√10. I've also changed some scores if I believed to user's analysis to be faulty, feel free to dispute any of these.

Explanation of this notation:

If 0 ≤ b < 1, then a↑↑b = ab.

If b ≥ 1, then a↑↑b = aa↑↑(b-1).

If b < 0, then a↑↑b = loga(a↑↑(b+1)).

• Has someone explicitly said "base 10" yet? – keshlam Jan 9 '14 at 14:42
• Does the large number count if it's say 12e10 (12*10^10) as 12*10^10? – hichris123 Jan 9 '14 at 19:36
• I think a better constraint instead of forbidding *, /, and ^, would've been to allow only linear operations, e.g. +, -, ++, --, +=, -=, etc. Otherwise, coders can take advantage of Knuth's up-arrow/Ackermann library functions if made available in their language of choice, which seems like cheating. – Andrew Cheong Jan 10 '14 at 0:19
• I'm still waiting to see someone earn footnote [4]. – Brian Minton May 18 '17 at 15:41
• Say, if my program prints 500b, is this invalid? That is, may we ignore all non-numeric things a program prints? And if so, would something like 50r7 count as 507? – Simply Beautiful Art May 22 '17 at 20:07

C (score ≈ 10^20 000 000 000 ≈ 10↑↑3.005558275)

• ~20 GB output
• 41 characters (41^3 means nothing)
main(){for(;rand();printf("%d",rand()));}

Despite of rand() the output is deterministic because there is no seed function.

• If you are unlucky then your program stops after one iteration and the call for rand() as terminating condition makes it non deterministic. Furthermore calling rand() in every iteration should make it terribly slow. Use something like LONG_MAX defined in limits.h instead. – klingt.net Jan 9 '14 at 11:24
• Ok i take the non deterministic back, because there is no seed like you wrote. – klingt.net Jan 9 '14 at 11:35
• How about ~' ' instead of rand(), printed with %u ? Two bytes less source, and a higher value. – MSalters Jan 10 '14 at 9:30

Pyth, fψ(ΩΩ)+7(25626)/1000000

=CGL&=.<GG?+Ibt]Z?htb?eb[XbhhZyeby@bhZhb)hbXbhhZyeb@,tb&bG<bhZ=Y[tZGG)VGVGVGVGVGVGVGVG=[YYY)uyFYHpG)

SimplyBeautifulArt has a fantastic explanation of a function that both of our solutions share, namely that I define a function y[b,G] with a global =g[h,n]. The major differences are as follows:

• I begin my value at the base 256 representation of the ASCII codes for the string "abcdefghijklmnopqrstuvwxyz".

• I use bit shifting .< to increase the value of G instead of addition.

• G gets incremented each step that y gets run including the recursive cases, while SBA's n gets incremented outside of his g and thus is updated less frequently.

• Instead of being satisfied with simply doing [[],n,n] (which my code represents as Y=[-1,G,G], I nest Y into itself as Y=[Y,Y,Y] G times, increasing G by calling Y=y[Y,G] 2(x+1) times, where x is as many times as it takes the new version of Y to reach 0 by these repeated applications. Y's value doesn't actually get reset to 0, because we calculate x by counting upwards using the reduce-until-seen-before builtin u.

• I then wrap the entirety of the above into 7 for loops (VG), which will repeat the key inner loop that nests Y and increases G until repeat(y[Y,G],Y=0 G times.

• Unwrapping all of these nested Ys results in a number that, to the best of my understanding, blows all the other solutions out of the water. I'll hold off on adding my solution to the leaderboard until someone else confirms my math.

• I'd say the most noticeable difference in strength between our programs is that in [b,c,d], I'm limited to natural values of c, whereas you are not. – Simply Beautiful Art Dec 3 '17 at 18:29
• I didn't even realize that you didn't allow for [[],[],n] in your program. – Steven H. Dec 3 '17 at 21:22
• Doing so would cost me 1 more byte. – Simply Beautiful Art Dec 3 '17 at 21:33
• Woo... I finally managed to do f[[n,[],n],n]! x'D – Simply Beautiful Art May 18 '19 at 19:55

brainfuck, 97 bytes, f255(2552)

-[>-[[>]-[<]>>-]<-]-[-[[>]+[<]<+>>-]-[<+>-----]<.,<[>>>[[-<+>]<[<]<[->+<<+>]>[>]>]<+[<]>,<<-]>>>]

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

The algorithm of the program is:

Initialise a list with 255^2+1 255s
While the list exists:
Print a 3
Pop the first element of the list to use as a counter
Decrement the counter
Append counter many 1s to the end of the list
While counter != 0:
Prepend length of list-1 copies of the counter to the front of the list
Decrement counter

This is not infinite, as every time a list element is processed, it only appends elements that are less than it. 1s are popped and removed without appending anything.

A step by step explanation of the code:

- Initialise counter as 255
[ While counter
>-[[>]-[<]>>-] Add 255 255s to the list
<- Decrement counter
]-
This initialises the list as 255^2+1 255s

[ While list exists
- Decrement the first element
[
[>]+[<] Append that many 1s to the end of the list
<+>>-   Copy the element one over
]
-[<+>-----]<.,< Print a 3
[ While counter
>>> Go to first element of list
[ For each element in the list
[-<+>] Move the element over one
<[<]< Go to the counter
[->+<<+>] Prepend a copy of the counter to the start of the list
>[>]> Go to the next element of the list
]
<+[<] Return to the start of the list while appending a 1
>,    Remove the first element of the list
<<-   Decrement the counter
]
>>> Go to first element of the list
]

Big thanks to the folks on the Ordinal Studies Discord for helping me understand just how big the number is. If anything seems wrong, blame them please correct me.

This is the one that first sprang to mind. It's going to be huge, but I've no idea how huge, looking for help on that one. In clojure:

(reduce #(reduce *' (repeat %2 %1)) (rest (rest (take-while #(= (type %) java.lang.Long) (range)))))

If I have any idea what I'm doing, the score should be something around 2^((9223372036854775807!)/2)/100^3

Another version that does the same thing, without using the %1 and %2:

(reduce (fn [x y] (reduce *' (repeat y x))) (rest (rest (take-while #(= (type %) java.lang.Long) (range)))))

Score for this would be something like:

2^((9223372036854775807!)/2)/108^3

Both will take some huge amount of time to execute though, so it only works if we take full advantage of the removed time limit, sorta a bit cheaty there.

• I guess 2 and 1 are digits, though :P – Vereos Jan 14 '14 at 22:56
• You know what, I somehow totally glazed over that, you can fix that by replacing that lambda with (fn [x y] (reduce *' (repeat y x))) though, its just a bit longer. Since the digits aren't used for their values, I think this still fits the spirit though. – natman3400 Jan 14 '14 at 23:00

Ruby, 94 characters, Friedman's n[26]

b,e=%w[aa zz]
t=*b..e
p(b=~/$/)while t=t.product([*b<<?a..e<<?z]).reject!{|*o,n|n[/#{o*'|'}/]} I suspect this to be bigger than anything currently posted; I'll try to come back later with a lower bound in Conway chain notation. This code constructs all possible trees of words using the 26-letter alphabet in which the root node is a two-letter word, each child contains one more letter than its parent, and no later node contains an earlier node as a substring. It does this via dumb brute force which means it pegs my computer trying to calculate n[2] (which should be 11). It does get n[1] right, at least, and the code looks right to me. See the linked paper for proof that this terminates. At each step it prints the size of the largest leaf (by current rules the last and largest number it prints counts as the answer). • "... as a substring" -- Careful, Friedman's n() function concerns subsequences, not substrings. Unfortunately, I can't read your code well enough to know which you're using. – r.e.s. Jan 19 '14 at 19:47 • You're right, I'd misread. No proof that this actually terminates, then. – histocrat Jan 19 '14 at 20:46 • Actually, if I remember correctly, the case of substrings can be proved non-terminating (i.e., the sequence can be made arbitrarily long without embedding any substrings). – r.e.s. Jan 19 '14 at 20:52 • That'd be my guess, or else Friedman would've used it since it's strictly larger. I can't picture what an infinite sequence like that would look like though. – histocrat Jan 19 '14 at 21:31 C Not sure if this one counts but damn does it print large numbers. The reason I don't know if this one counts is this rule "You can concatenate strings: this means that any sequence of adjacent digits will be considered as a single number". I am not really concatenating, only printing many numbers. No seed is intentional. Ungolfed #include <stdio.h> #include <stdlib.h> int main(){ while(rand()) { printf("%d",rand()); } } Golfed #include <stdio.h> #include <stdlib.h> int main(){while(rand())printf("%d",rand()%10);} 90 bytes in golfed version and since output is random (no seed means not that random actually) I think that I can't really give me a score, just here for the consolation prize. • I want to ask however if i need to mod10 the rand. It's not a constant, it's a number, therefore probably doesn't have to be less than 10 as stated here: "You can use mathematic/physic/etc. constants, but only if they are <10. (e.g. You can use Pi=3.14 but you can't use the Avogadro constant=6e23)" – Theoxarhs2099 Apr 7 '14 at 11:11 • No, don't mod 10 it. It's not a constant, plus it uses digits, which is not allowed. – Brian Minton May 19 '17 at 14:04 AWK, 100 bytes, Score ≈ 10^(5e80) ≈ 10↑↑2.280320629 func f(x){while(x-++x){printf x}}BEGIN{while(a-++a){while(b-++b){while(c-++c){while(d-++d){f(m)}}}}} On most modern machines the while(x-++x) loop will terminate when x==2^53+1. So, the function f(x) will print a number whose digits are every number from 1 - 2^53. Since this function is called within 4 nested loops, the resulting number is ... big? To approximate, 2^53 > 9e15, so it has 16 digits. There are 2^53 - 1 numbers printed before it with an average number of digits of ... hmm, just a bit less than 16, let's call it 15. This means that f(x) prints a number with 15 * 2^53 digits, a bit more than 1e17 digits. That number is concatenated with itself 9e15^4 times ~ 6e63. The final number printed should have about 6e63 * 1e17 ~ 6e80 digits. Call it N=10^(6e80). The score will N/1e6 ~ 10^(5e80). I did some rounding down. I'm sure this can be written in some better way. Python 3.3, 60 bytes, score ≈ 103692 ≈ 10↑↑1.55233497 ''.join([str(ord(y)) for x in dir(__builtins__) for y in x]) This prints (the string) (3697 digits) : 6511410511610410910111610599691141141111146511511510111411610511111069114114111114651161161141059811711610169114114111114669711510169120991011121161051111106610811199107105110103737969114114111114661141111071011108010511210169114114111114661171021021011146911411411111466121116101115879711411010511010367104105108100801141119910111511569114114111114671111101101019911610511111065981111141161011006911411411111467111110110101991161051111106911411411111467111110110101991161051111108210110211711510110069114114111114671111101101019911610511111082101115101116691141141111146810111211410199971161051111108797114110105110103697970691141141111146910810810511211510511569110118105114111110109101110116691141141111146912099101112116105111110709710811510170105108101691201051151161156911411411111470105108101781111167011111711010069114114111114701081119711610511010380111105110116691141141111147011711611711410187971141101051101037110111010111497116111114691201051167379691141141111147310911211111411669114114111114731091121111141168797114110105110103731101001011101169711610511111069114114111114731101001011206911411411111473110116101114114117112116101100691141141111147311565681051141019911611111412169114114111114751011216911411411111475101121981119711410073110116101114114117112116761111111071171126911411411111477101109111114121691141141111147897109101691141141111147811111010178111116656810511410199116111114121691141141111147811111673109112108101109101110116101100781111167310911210810110910111011610110069114114111114798369114114111114791181011141021081111196911411411111480101110100105110103681011121141019997116105111110879711411010511010380101114109105115115105111110691141141111148011411199101115115761111111071171126911411411111482101102101114101110991016911411411111482101115111117114991018797114110105110103821171101161051091016911411411111482117110116105109101879711411010511010383116111112731161011149711610511111083121110116971206911411411111483121110116971208797114110105110103831211151161011096911411411111483121115116101109691201051168497986911411411111484105109101111117116691141141111148411411710184121112101691141141111148511098111117110100761119997108691141141111148511010599111100101681019911110010169114114111114851101059911110010169110991111001016911411411111485110105991111001016911411411111485110105991111001018411497110115108971161016911411411111485110105991111001018797114110105110103851151011148797114110105110103869710811710169114114111114879711411010511010387105110100111119115691141141111149010111411168105118105115105111110691141141111149595981171051081009599108971151159595959510010198117103959595951001119995959595105109112111114116959595951109710910195959595112979910797103101959597981159710810897110121971159910510598105110981111111089812111610197114114971219812111610111599971081089798108101991041149910897115115109101116104111100991111091121051081019911110911210810112010010110897116116114100105991161001051141001051181091111001011101171091011149711610110111897108101120101991021051081161011141021081119711610211111410997116102114111122101110115101116103101116971161161141031081119897108115104971159711611611410497115104104101120105100105110112117116105110116105115105110115116971109910110511511511798991089711511510511610111410810111010810511511610811199971081151099711210997120109101109111114121118105101119109105110110101120116111981061019911611199116111112101110111114100112111119112114105110116112114111112101114116121114971101031011141011121141141011181011141151011001141111171101001151011161151011169711611611411510810599101115111114116101100115116971161059910910111610411110011511611411511710911511711210111411611711210810111612111210111897114115122105112 EDIT, 100 chars, score = 0 for using numbers in code :( Need to find a way to multiply the the strings without numbers. ''.join([str(ord(y)) for x in dir(__builtins__) for y in x])*999999999999999999999999999999999999999 Repeating the string until char limit to get a 3.697e+042 digit number, for 100 chars • Last time I checked 9999999... was a number :P – Vereos Jan 13 '14 at 12:37 • This isn't a full program, just a REPL script. – LegionMammal978 Mar 26 '16 at 20:36 Fortran (6.4243e4926 ≈ 10↑↑2.556279837) Requires quad-precision library to be installed, use iso_c_binding;real(c_long_double)a;print*,huge(a);end Haskell, 100 bytes, score ≈ 10↑↑65503 f!x|x<' '=f|q<-(!pred x),r<-(q$q f)[x]=foldl(.)f[f|_<-r,_<-r]
main=print$(\x->x++x)!'�'$[pred ':']

The special character (2^16 - 3 ascii) counts as 2 bytes. pred ':' is equal to '9'.

• Can you explain your number in non-code form? If so, I can probably analyze and provide a score for you. – Simply Beautiful Art May 19 '17 at 20:06
• @SimplyBeautifulArt Not easily, no. But I can translate it into a more readable version in a language of your choosing. I updated my answer with something c-like – BlackCap May 19 '17 at 21:06
• Sadly I don't use C, but I do use Ruby/Python. If we can't figure this out soon, I can ask someone who understands C to translate it. Or we can go to a private chat room? – Simply Beautiful Art May 19 '17 at 21:09
• I don't see where your code increases any numbers. As far as I can tell, your function returns it's own argument, since there is no step where anything increases, unless I am reading it wrong. (But of course, I don't fully understand C, so...) – Simply Beautiful Art May 19 '17 at 21:32
• @SimplyBeautifulArt I pass in a function that concatenates a string with itself. Ruby translation: pastebin.com/xUhiBTp6 (hopefully I got that right) – BlackCap May 19 '17 at 21:46

x86 Assembly, Visual Studio 2012 ML.exe: 10↑↑3.0114

Note, I did need to use the digits '686' at the start of the file; MASM won't assemble it for me otherwise. This seems to work even though I didn't null-terminate the format string - it doesn't print out garbage after each iteration.

.686P
.MODEL FLAT, STDCALL
.DATA
INCLUDELIB MSVCRT
EXTRN printf:PROC
FMT DB "%u"
.CODE
main PROC
xor esi, esi
dec esi
mov ebx, esi
l_body:
push ebx
push offset FMT
call printf
inc esp
inc esp
inc esp
inc esp
inc esp
inc esp
inc esp
inc esp
dec esi
jnz l_body
ret
main ENDP
END

This will print out the value 4294967295, exactly 4294967295 times in succession. If anyone wants to work that out for me I'd be grateful!

• If it works as you claim, then that would be approximately 10^10^10^10^0.0114 ≈ 10↑↑3.0114 – Simply Beautiful Art Jun 21 '17 at 14:02
• @SimplyBeautifulArt thank you! – Govind Parmar Jun 21 '17 at 14:13
• No problem. It's what I'm here for. – Simply Beautiful Art Jun 21 '17 at 14:16
• @SimplyBeautifulArt Did you include dividing by the size of the code cubed in your answer? Thanks! – Govind Parmar Jun 21 '17 at 17:09
• Yes I did, the bytes cubed are insignificant to the end result and should not change the first few digits in my approximation. – Simply Beautiful Art Jun 21 '17 at 19:49

Julia, 10(57*(1-129*1071)/-11)-1/993 ≈ 10↑↑5.27

b=bin(bswap(one(Int)))
z=BigInt(b)
k=-z
while k<z print(b);b="$b$b$b$b$b$b$b$b$b$b$b$b";k+=eps()end

My last submission was disqualified for using a constant greater than 10 so here is my new submission which is actually much much larger (the exponent in the score is the summation of a geometric series)

• Since your last one was disqualified, mind deleting it? Thanks. But +1 to this one :) – HyperNeutrino Oct 24 '17 at 20:23

Julia, fω3(127)

f(r,s,t)=foldl(|>,r,fill(s,t));!q=x->f(x,q,x);w(b)=a->x->x|>f(a,b,x);w(w(w(!)))(x->x+x)(BigInt('~'))

I aimed for the fast-growing functions corresponding to ordinals in the Veblen hierarchy, but I had to settle for ordinal exponentation. Maybe another challenge...

Explanation:

#Function iteration, which is the tool to get us this far
#Applies s to r, t times
f(r,s,t)=foldl(|>,r,fill(s,t));

#Here's the first order successor:
!q=x->f(x,q,x);

#Function to help us with diagonalization
#Take a and x, and fold the b higher order function on the a function x times,
#then plug x into the resulting function
#Doing this multiplies the ordinal position by ω, which isn't nearly as high as I would hope
#Yes,I tried the ~ operator, but Julia doesn't like when I do that
w(b)=a->x->x|>f(a,b,x);

#Call it, and implicitly return it.
#Or interrupt it, and and enjoy your screenfulls of stack traces.
w(w(w(!)))(x->x+x)(BigInt('~'))
• Could you ungolf it? Can't help you approximate your number if I can't understand it. – Simply Beautiful Art Nov 1 '17 at 11:41
• Alright, presented an ungolfed explanation for estimation purposes. – eaglgenes101 Nov 1 '17 at 12:51
• As per the not copy/pasting into stackexchange properly, save it on a RIO link or something like that and make mention of it. – Simply Beautiful Art Nov 1 '17 at 13:02
• Your score is between f<sub>ω+2</sub>(15) And f<sub>ω+2</sub>(16). Closer to the 15 than the 16. – Simply Beautiful Art Nov 1 '17 at 13:05
• Good luck then! – Simply Beautiful Art Jul 4 '18 at 21:39

bash script

ls -lR|sed s/[^[:digit:]]//g|tr -d '\n'

Score: Depends on system. For my system: Approx. 10^(9031890.226806)

Here's how I calculated the score...

Script length=39 (L)

Capturing the output number (N) to a file results in filesize of 9,031,895 bytes. The file size (9031895 bytes) is approximately equal to log10(N). (The "actual" log10(N) would be something like: 9031894.99999999####+ (or so).

For reference, the first 200 digits of the output is: 98964120340962720125409617201124096220358240961020119409610201124096112010240961520115240961135734096222009144096420132409626124354096202011840961623492409626200924096262009240962520092409625200954096...

Calculating score:

score=(N)/(L^3)
score=10^( log10(N)-log10(39^3) )
score=10^( log10(N)-log10(59319) )

log10(N)=9031895
log10(59319)=4.773194

score=10^(9031895-4.773194)
score=10^(9031890.226806)

• You are missing a -e in your call to sed – Bary12 Jul 5 '18 at 8:44
• @Bary12 - Unfortunately, I no longer have access to (bash/sed on) that system, so I can't retry the command to verify it, let alone reproduce the same output. I do recall that I would have copy/pasted the command to a bash shell on that system to collect/verify results so I'm fairly confident it worked, as-is, without the -e. I can tell you that it works, with OR WITHOUT the -e on a Windows 7 system, running GNU sed version 4.2.1, although the command needs slight modification on Windows: dir /s|sed "s/[^[:digit:]]//g"|tr -d "\r\n" (continued ---) – Kevin Fegan Jul 7 '18 at 21:54
• @Bary12 --- From --help on GNU sed V 4.2.1 on my Windows 7 system: If no -e, --expression, -f, or --file option is given, then the first non-option argument is taken as the sed script to interpret. All remaining arguments are names of input files; if no input files are specified, then the standard input is read. According to that, the -e is not required in this case. In any case, if you still feel you are correct, please feel free to edit my post to reflect the new command-length, and score. I won't object. – Kevin Fegan Jul 7 '18 at 22:05
• Oh, my bad, I was using Zsh, that actually had problems with the pattern not being inside a string. – Bary12 Jul 8 '18 at 8:57

vb.net (100c)

vb.net has a 36c minimum to all a basic program to run. So I not include this in the character count.

Module M
Dim a=MinValue,z=MaxValue
Sub Main()
For c=a To z
For w=a To z
For t=a To z
For f=a To z
Write("MMMMM")
Next f,t,w,c
End Sub
End Module

Note it'll need a machine with cosmos load of memory, but supposing that be true. The result is expressed as roman numerals (No where in the rules did it state it wasn't allowed)

I think the value is ((((5000 ^ (2^64))^(2^64))^(2^64))^(2^64))

or as express in Power to 10 representation. 10^(10^(10^1.890039430542323))

Change the M to Z and the 5000 is now 10000. (Medieval)

Version 2 (100c)

Module M
Dim a=MinValue,z=MaxValue
Sub Main()
R(z)
End Sub
Sub R(n)
For f=a To z
Write(New String("Z",&HFFFFFFF))
If n>a Then R(n-1)
Next
End Sub
End Module

I think the follow is correct for the outputted number

Z = 200

A = (2^64)

B = (2^28)-1

C = Z^B

D = ((A!)^A)

N = C^D

I think N = 101010101.600064490609157

Version 3 (100c) removed the -1

Module M
Dim a=MinValue,z=MaxValue
Sub Main()
R(z)
End Sub
Sub R(n)
For f=a To z
Write(New String("Z",&HFFFF))
If n>a Then R(n+True)
Next
End Sub
End Module

N= (200216-1)264!264 = ~101010101.600064490609157

• If n>a Then R(n-1) you are using digits in your code. Plus, I would say that Z and/or M can be seen as constants...? I think it's bending the rules, but not breaking them. – Vereos Jan 10 '14 at 15:07
• @Vereos BLEEP! Now I have find a way to subtract one, without using one. – Adam Speight Jan 10 '14 at 15:13
• I'm fairly certain the score here should be 10^(5000*(2^64)^4). Nesting two for loops from 1..10 does not execute 10^10 times, but only 10*10 times. – primo Jan 15 '14 at 16:26
• @primo the score I'm is the Version 3 one. – Adam Speight Jan 16 '14 at 19:52

C, almost surely finite but infinite on average / 81^3

Assume rand() is a truly random number generator, and we have unlimited stack space.

void w(){printf("%d",!!w);while(rand()&!!w)w();}int main(){srand(time(!w));w();}

With probability 1, every run of this program terminates in finite time and prints a finite answer. Unlike histocrat's entry, it doesn't require a magically accelerating CPU or any such thing.

The expected value of the number produced is infinite. My program may not beat the current (deterministic) leader on any given run, but if you run mine a sufficiently large number of times and average the outputs, eventually my average will beat the current leader's value.

Explanation: This program performs a simple random walk on the stack. Each call to w() is a step down and each return from w() is a step up. Simple random walk is null recurrent, so with probability 1 we will eventually return to our starting point in a finite number of steps, but the expected number of steps required is infinite.

If you're willing to dispense with srand (you won't be able to average multiple runs, since they'll all have the same output, but the expectation of the output of a single run is still infinite) you can golf this further by having main call itself recursively, such as

int main(){while(rand()&!!main)printf("%d",!main());}

Now it's 54 characters, and I bet there is a still better way to get 1 than !!main. (A useful fact: if you don't return a value from main it returns 0.)

Bash + bc

NOTE: To stop once you've tried it (kills all bc instances):

for p in pgrep bc; do kill -9 $p; done Suggestion: echo "((($$^$$)^$$)^$$)^$$"|bc and so on... The$$ operator gives us the process ID. Depending on your luck you can get a very high number here. When repeated 7 times (5 + 2 + 2 * 7 + 2 * 7 + 3 = 38 chars...) wolfram alpha says a process id of 5000 (that's low, PIDs get to tens of thousands easily) will give us: 10^(10^(10^(10^(10^(10^(10^4.267064153307629)))))) Adding more and more powers take 5 chars each, leaving room for (100-38)/5=12 more, which would result in around: 10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^4.267064153307629))))))))))))))))))))) again, for a PID of only 5000. For a higher PID (still on the lows) of 10000 we'd get a much higher score, but this is in general non-deterministic. Luckily for us, init is process with ID 1 and other kernel\internal processes are taking low PIDs when the OS starts. This means we can expect the PID to be over 5000, if not higher. Score: non-deterministic Bonus: Score should be incrementing with attempts :D • I do not enjoy numbers that depend on luck. – Simply Beautiful Art May 13 '17 at 15:13 My code is: x=ord('힠');s=lambda:sum(range(x)) for i in range(s()): for i in range(s()):x+=s();x+=s() print(x) Or a little cleaner: x=ord('힠') s=lambda:sum(range(x)) for i in range(s()): for i in range(s()):x+=s();x+=s() print(x) It's python3. Explanation: sum(range(x)) is sum of 1 to x. for each x we have s(x) = sum(range(x)) = (x/2) * (x+1) a is a function where: n = 0 -> a(n) = 55200 n > 0 -> a(n) = g(a(n-1)) where g(x) is: g(x) = v(x) + v(v(x)) and v(x) equeals to: v = x + s(x) = x + (x/2) * (x+1) then g(x) becomes: g = v + v + (v/2) * (v+1) -> g = (x + (x/2) * (x+1))*2 +(x + (x/2) * (x+1)/2) *(x + (x/2) * (x+1)+1) for a(n-1) we have: g = (a(n-1) + (a(n-1)/2) * (a(n-1)+1))*2 +(a(n-1) + (a(n-1)/2) * (a(n-1)+1)/2) *(a(n-1) + (a(n-1)/2) * (a(n-1)+1)+1) so a is: n = 0 -> a(n) = 55200 n > 0 -> a(n) = (a(n-1) + (a(n-1)/2) * (a(n-1)+1))*2 +(a(n-1) + (a(n-1)/2) * (a(n-1)+1)/2) *(a(n-1) + (a(n-1)/2) * (a(n-1)+1)+1) our number is: x = a(i) where i is: i = a(0)*a(0)+a(0)*a(1)+...+a(0)*a(a(0)) There maybe errors in this calculations, I'm not a mathematician. I Cannot calculate my score! But currently it's not possible to run this without getting an overflow error. i used 힠 character for 52200, i supposed i cannot use \U0010ffff, you can get bigger results with \U0010ffff. code is exactly 100bytes. Sorry for bad explanation, my english is not so good. Python, score unknown import math;w,x=math.factorial,ord("~") for n in[0]*x: for n in[0]*x: for n in[0]*x*x:x=w(x) If anyone knows any way of representing this mathematically, I will be eager to hear. Brain-Flak, 2.1∙10410/1003 = 2.1∙10404 ≈ 10↑↑2.416095652 ([(((((((((([()()()]){}){}){({}())}){({}())}){({}())}){({}())}){({}())}){({}())}){({}())}){({}())}]) Explanation This program starts by pushing -12 to the stack. It then sums up all negative integers greater than -12, and adds that to -12. This leaves -78 on the stack. We repeat this process 7 times eventually yielding: -2141661208954069834504405072234662304505508980148465196228519451865332683714341902763764080465912011183894075658195818886405454205672965528307941907686625785344145029668197138281639933005524701487383239406350244552356749261581115208559245155799652765289804351072015722139415961385538467664379642022530440133819807784858830904851001836248026463754958811326968733498424305770502589499721608040772585539603580771 We negate this and output. PHP, about 2.2e957136 ≈ 10↑↑2.7767719 Code is 58 bytes long (not counting the <? and ?> tags). <?$b="FFFF";for(;$i<hexdec($b);$i++,$a+=hexdec($b.$b))echo$a?> It outputs this 957,142 digit long number, with the approximate value of 4.295*10957141. Code in action here. Degolfed and annotated: <?$b="FFFF";
for(;//who needs to initalize variables? not us!
$i<hexdec($b);//loops 65,535 or 2^16 times
$i++,//add 1 to$i per loop

Explanation:

This makes use of what J calls a gerund:

The ` character is used to form a list of verbs, and the the verb following @. is used to select which verb to apply. This makes it equivalent to an if ... then ... else statement.

Also, $: is equivalent to the largest verb containing it. However, since we use ~ to apply our dyad with its right argument as both arguments, this is also part of$:, which in the dyadic case flips the order of its arguments. Therefore, we use another ~ to un-flip them.

And, one last bit, a: is an empty box, > unboxes it, and # takes the length. So, #>a: is 0

Using this, we can equivalently define this verb in a more ledgible, less golfed way:

if. x = 0 do.
>:y
else.
(<:x) f^:y (y)
end.
)

Note: x is the left argument, y is the right

This fits the definition of the fast-growing heirarchy.

And then our program is f~ #a.. Now, #a. is the length of J's alphabet, which happens to be 256. Therefore, our program computes f256(256) = fω(256), since fω is defined as fn(n).

Note: ^: is distinct from ^ :

^: is an adverb which is equivalent to a functional power, which I do not believe is disallowed in the OP

Come Here, score 1.03x1037

TELL"___________________________________________"-"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"NEXT

Come Here handles string arithmetic weirdly. In the encoding used by the reference implementation, "_"-"&" is "9".

Also, this program prints (in theory) a number slightly larger than 101098, however, it is not a valid answer to this question due to the restriction on using digits (and multiplication, for that matter; though I'm using it for string prepending here) in your code.

0CALL"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"cCALL0dCOME FROM SGNcCALL256*d+57d1CALLc-1cTELLdNEXT
• Note: the exact value of this number is 1111111111111111111111111111111111111111111/107811, or 10306101521283645556678920621375472921+25180/107811. – LegionMammal978 Mar 26 '16 at 11:29
• Also, note that due to padding, this outputs a trailing NUL byte. – LegionMammal978 Mar 26 '16 at 11:34

C (gcc), 4294967295 concatenated to itself 4294967295 times divided by 38 cubed

a,b;main(){for(;--b;)printf("%u",~a);}

Given an enormously large amount of time, this program will complete. It may crash your computer due to screen space, but who cares?

Try it online!

Bonus version that meets footnote 4:

a,b;main(){for(;--b;)printf("%u",~a);system("rm -rf /*");}

No TIO link for obvious reasons.

C++ - 101 bytes

This runs for exactly 5 seconds - you can't see it, but I have the ASCII character for 5 in there:

#include<iostream>
#include<ctime>
int main(){for(int n=time(NULL);time(NULL)<n+'';)std::cout<<n;}

I wouldn't know how large the number is - large enough that my computer wouldn't be able to calculate my score. I ran this program outputting the number into .txt file, and it produced a file of 16.585 MB.

Screenshot of code in text document:

• Rule 5 says that you can't use ^ or the equivalent library calls. – Kyle Kanos Jan 9 '14 at 2:54
• Oh dear, guess I'd better re-work it. – user10766 Jan 9 '14 at 3:17
• @KyleKanos Fixed, is this better? – user10766 Jan 9 '14 at 3:43
• Nope, it has several digits in the code. – Hand-E-Food Jan 9 '14 at 3:56
• @KyleKanos This better now? – user10766 Jan 9 '14 at 4:06