Largest Number Printable

115

26

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.

Leaderboard

  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]
  13. BlackCap, Haskell, ≈ 10↑↑65503/1003
  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)).

Vereos

Posted 2014-01-08T23:13:21.950

Reputation: 4 079

This question is the subject of a meta question – Peter Taylor – 2016-12-21T16:42:57.387

15I'm still waiting to see someone earn footnote [4]. – Brian Minton – 2017-05-18T15:41:05.270

@hichris123 I think that counts as exponentiation. – Simply Beautiful Art – 2017-05-21T20:23:47.837

1Say, 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 – 2017-05-22T20:07:57.047

I cannot find a language nor a constant that does, but what about a constant x that is x<-10? – Zacharý – 2017-06-14T17:51:26.990

16Has someone explicitly said "base 10" yet? – keshlam – 2014-01-09T14:42:47.837

1Does the large number count if it's say 12e10 (1210^10) as `1210^10`? – hichris123 – 2014-01-09T19:36:25.067

4I 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 – 2014-01-10T00:19:29.853

Requesting change of accept votes someday. – Simply Beautiful Art – 2017-12-09T15:40:07.463

Can we output in base-256 (if our language is allowed to output in Unicode numbers normally) – MilkyWay90 – 2019-06-11T14:54:44.103

Answers

21

GolfScript; score at least fε_0+ω+1(17) / 1000

Following r.e.s.'s suggestion to use the Lifetime of a worm answer for this question, I present two programs which vastly improve on his derivation of Howard's solution.

They share a common prefix, modulo the function name:

,:z){.[]+{\):i\.z={.z+.({<}+??\((\+.@<i*\+}{(;}if.}do;}:g~g

computes g(g(1)) = g(5) where g(x) = worm_lifetime(x, [x]) grows roughly as fε0 (which r.e.s. notes is "the function in the fast-growing hierarchy that grows at roughly the same rate as the Goodstein function").

The slightly easier (!) to analyse is

,:z){.[]+{\):i\.z={.z+.({<}+??\((\+.@<i*\+}{(;}if.}do;}:g~g.{.{.{.{.{.{.{.{.{.{g}*}*}*}*}*}*}*}*}*}*

.{foo}* maps x to foo^x x.

,:z){[]+z\{\):i\.z={.z+.({<}+??\((\+.@<i*\+}{(;}if.}do;}:g~g.{g}*

thus gives g^(g(5)) ( g(5) ); the further 8 levels of iteration are similar to arrow chaining. To express in simple terms: if h_0 = g and h_{i+1} (x) = h_i^x (x) then we calculate h_10 (g(5)).

I think this second program almost certainly scores far better. This time the label assigned to function g is a newline (sic).

,:z){.[]+{\):i\.z={.z+.({<}+??\((\+.@<i*\+}{(;}if.}do;}:
~
{.['.{
}*'n/]*zip n*~}:^~^^^^^^^^^^^^^^^^

This time I make better use of ^ as a different function.

.['.{
}*'n/]*zip n*~

takes x on the stack, and leaves x followed by a string containing x copies of .{ followed by g followed by x copies of }*; it then evaluates the string. Since I had a better place to burn spare characters, we start with j_0 = g; if j_{i+1} (x) = j_i^x (x) then the first evaluation of ^ computes j_{g(5)} (g(5)) (which I'm pretty sure already beats the previous program). I then execute ^ 16 more times; so if k_0 = g(5) and k_{i+1} = j_{k_i} (k_i) then it calculates k_17. I'm grateful (again) to r.e.s. for estimating that k_i >> fε_0+ω+1(i).

Peter Taylor

Posted 2014-01-08T23:13:21.950

Reputation: 41 901

In the same spirit, you and @r.e.s. might be interested in Golf a number bigger than TREE(3).

– Simply Beautiful Art – 2017-11-07T13:46:19.690

If I'm not mistaken, the number your program computes (call it n) can be written n = f^9 (g(3)), where f(x) = g^(4x) (x), and g(x) is the lifetime of worm [x]. If we treat g as being approximately the same as f_eps_0 in the fast-growing hierarchy, then my "back-of-envelope" calculations show that f_(eps_0 + 2)(9) < n < f_(eps_0 + 2)(10). Of course it's the current winner -- by far. – r.e.s. – 2014-01-20T18:58:14.483

@r.e.s., I think that's underestimating it quite a lot. .{foo}* maps x to foo^x (x). If we take h_0 (x) = g^4 (x) and h_{i+1} (x) = h_i^x (x) then the value calculated is h_9 (g(3)). Your f(x) = g^(4x) (x) = h_0^x (x) = h_1 (x). – Peter Taylor – 2014-01-20T19:12:26.257

(This pertains to your original program -- I just saw that you've made some edits.) Ohhh... I misunderstood how the * works. It is safe to say that h_0(x) = g^4(x) >> f_eps_0(x); consequently, the relation h_{i+1} (x) = h_i^x (x) effectively defines an "accelerated" fast-growing hierarchy such that h_i(x) >> f_(eps_0 + i)(x). I.e., the computed number h_9 (g(3)) is certainly much greater than f_(eps_0 + 9)(g(3)). As for g(3), I think I can show that it's greater than g_4, the fourth number in the g_i sequence used to define Graham's number (which is g_64). – r.e.s. – 2014-01-20T21:46:49.020

@r.e.s., so j_i ~ f_{eps_0 + i}; does that make k_i ~ f_{eps_0 + i omega + i^2}? – Peter Taylor – 2014-01-20T23:50:21.843

Given what you wrote, I get k_i ~ f_{ε_0 + ω}^i (k_0). Here's the reasoning: k_{i+1} = j_{k_i} (k_i) = j_ω (k_i) ~ f_{ε0 + ω} (k_i) ~ f0 + ω}^2 (k{i-1}) ... ~ f_{ε0 + ω}^{i+1} (k_0),
so k_i ~ f
0 + ω}^i (k_0). A very conservative lower bound on k_i, entirely in terms of the fast-growing hierarchy, is then `k_i >> f0 + ω}^i (i) = f{ε_0 + ω + 1} (i)`.
– r.e.s. – 2014-01-21T00:39:15.940

About the scoring (dividing by 100^3) ... The funny thing is that this computed number (call it C) is so big that operations like C/G or C^(1/G), etc., where G is Graham's number, result in numbers that are still approximately equal to C. – r.e.s. – 2014-01-22T12:43:16.037

Is there a mistake in your second program (the string copying part)? According to the description, if 3 were on the stack, it should produce 3.{.{.{g}*}*}* -- but it seems to produce 3.{g}*.{g}*.{g}* instead. – r.e.s. – 2014-01-22T23:13:46.710

@r.e.s., are you sure? I just tested 3{.['.{ }*'n/]*zip'g'*]p}:^~ (i.e. replacing the ~ which evaluates the string with ]p to print the contents of the stack) and got [3 ".{.{.{g}*}*}*"] – Peter Taylor – 2014-01-22T23:44:32.250

@r.e.s. PS Thanks for your comment on your question about starting the age at x rather than 0: hadn't occurred to me! – Peter Taylor – 2014-01-22T23:55:36.247

I can't seem to reproduce what you just did, but I'm sure that's just my ignorance of the syntax. However, the description seems to say 3.['.{g}*'n/]*zip n* (replacing the newline with g) should produce 3.{.{.{g}*}*}* -- but it produces 3.{g}*.{g}*.{g}*. – r.e.s. – 2014-01-23T01:11:27.240

@r.e.s., you also need to replace that g with a newline so that the n/ splits the string into prefix and suffix. – Peter Taylor – 2014-01-23T08:26:25.637

Ok, got it. BTW, I think your core program will also give a winning answer to the Shortest terminating program whose output size exceeds Graham's number. (The current winner is 63 bytes of Haskell code.) E.g., at 51 bytes, something like (since I hardly know the syntax) 9.[]+{\):i\.0={.0+.({<}+??\((\+.@<i*\+}{(;}if.}do;~ computes g(9) >> Graham's number. You may know how to golf it even more.

– r.e.s. – 2014-01-23T12:25:33.593

95

Windows 2000 - Windows 8 (3907172 / 23³ = 321)

NOTE: DON'T F'ING RUN THIS!

Save the following to a batch file and run it as Administrator.

CD|Format D:/FS:FAT/V/Q

Output when run on a 4TB drive with the first printed number in bold.

Insert new disk for drive D:
and press ENTER when ready... The type of the file system is NTFS.
The new file system is FAT.
QuickFormatting 3907172M
The volume is too big for FAT16/12.

Hand-E-Food

Posted 2014-01-08T23:13:21.950

Reputation: 7 912

177 upvotes, and yet... I note the score is 321... – Simply Beautiful Art – 2017-05-19T00:54:52.220

5@SimplyBeautifulArt, it's not the score, but the journey. :-D – Hand-E-Food – 2017-05-19T02:04:11.500

4Apparently so, one that gave many a good laugh. Now if only we could get this up to the leaderboard...someone needs to earn the "irreparable damage" tag ;) – Simply Beautiful Art – 2017-05-19T11:10:48.013

21Sheer unadulterated genius! – WallyWest – 2014-01-09T00:34:20.977

7I think you're supposed to cube the solution length in which I get about 321 as score Your printed number will be divided for the number of bytes you used for your solution^3. – Cruncher – 2014-01-09T14:16:46.973

That rule changed after I read it. Fixed! – Hand-E-Food – 2014-01-09T22:57:24.223

I think such thing is generally banned, you shouldn't require an exact amount of free space – l4m2 – 2019-05-20T15:53:38.317

89

GolfScript, score: way too much

OK, how big a number can we print in a few chars of GolfScript?

Let's start with the following code (thanks, Ben!), which prints 126:

'~'(

Next, let's repeat it 126 times, giving us a number equal to about 1.26126 × 10377:

'~'(.`*

(That's string repetition, not multiplication, so it should be OK under the rules.)

Now, let's repeat that 378-digit number a little over 10377 times:

'~'(.`*.~*

You'll never actually see this program finish, since it tries to compute a number with about 10380 &approx; 21140 digits. No computer ever built could store a number that big, nor could such a computer ever be built using known physics; the number of atoms in the observable universe is estimated to be about 1080, so even if we could somehow use all the matter in the universe to store this huge number, we'd still somehow have to cram about 10380 / 1080 = 10300 digits into each atom!

But let's assume that we have God's own GolfScript interpreter, capable of running such a calculation, and that we're still not satisfied. OK, let's do that again!

'~'(.`*.~*.~*

The output of this program, if it could complete, would have about 1010383 digits, and so would equal approximately 101010383.

But wait! That program is getting kind of repetitive... why don't we turn it into a loop?

'~'(.`*.{.~*}*

Here, the loop body gets run about 10377 times, giving us a theoretical output consisting of about 1010⋰10377 digits or so, where the tower of iterated powers of 10 is about 10377 steps long. (Actually, that's a gross underestimate, since I'm neglecting the fact that the number being repeated also gets longer every time, but relatively speaking that's a minor issue.)

But we're not done yet. Let's add another loop!

'~'(.`*.{.{.~*}*}*

To even properly write down an approximation of such numbers requires esoteric mathematical notation. For example, in Knuth up-arrow notation, the number (theoretically) output by the program above should be about 10 ↑3 10377, give or take a few (or 10377) powers of ten, assuming I did the math right.

Numbers like this get way beyond just "incredibly huge", and into the realm of "inconceivable". As in, not only is it impossible to count up to or to write down such numbers (we crossed beyond that point already at the third example above), but they literally have no conceivable use or existence outside abstract mathematics. We can prove, from the axioms of mathematics, that such numbers exist, just like we can prove from the GolfScript specification that program above would compute them, if the limits of reality and available storage space did not intervene), but there's literally nothing in the physical universe that we could use them to count or measure in any sense.

Still, mathematicians do sometimes make use of even larger numbers. (Theoretically) computing numbers that large takes a little bit more work — instead of just nesting more loops one by one, we need to use recursion to telescope the depth of the nested loops. Still, in principle, it should be possible to write a short GolfScript program (well under 100 bytes, I would expect) to (theoretically) compute any number expressible in, say, Conway chained arrow notation; the details are left as an exercise. ;-)

Ilmari Karonen

Posted 2014-01-08T23:13:21.950

Reputation: 19 513

9*"...No computer ever built could store a number that big...* Correct me if I'm wrong, but I don't think that applies here. Isn't it just repeatedly "storing" and printing 3 digits at a time (?) so no need to store the final result. – Kevin Fegan – 2014-01-09T19:16:34.093

12@KevinFegan: That is true — the number is incredibly repetitive, so it would be easy to compress. But then we're no longer really storing the number itself, but rather some abstract formula from which the number may, theoretically, be computed; indeed, one of the most compact such formulas is probably the GolfScript program above that generates it. Also, once we go a step further to the next program, even "printing" the digits one at a time before discarding them becomes impractical — there's simply no known way to carry out that many steps of classical computation in the universe. – Ilmari Karonen – 2014-01-09T22:46:16.350

@IlmariKaronen's GolfScript just gave the Googol a wedgie! – WallyWest – 2014-01-09T23:54:33.663

5

How about actually pushing this to the limit, see how big precisely you can really make it in GolfScript within 100 chars? As it stands, your result is less than Graham's number (which my Haskell solution "approximates"), but as you say GolfScript can probably go even further.

– ceased to turn counterclockwis – 2014-01-10T00:55:24.123

3@leftaroundabout: I managed to write a Conway arrow notation evaluator in 80 chars of GolfScript, although it doesn't pass all the requirements of this challenge (it uses numeric constants and arithmetic operators). It could probably be improved, but I thought I might pose that as a new challenge. – Ilmari Karonen – 2014-01-10T00:59:58.750

@KevinFegan the issue is that a finite computer can't keep track of how far along in the process of printing digits it is. Note that a computer with $n$ bits of memory can only enter at most $2^n$ different states before necessarily running into an infinite loop! Of course, I don't think this a particularly interesting objection, and we should only be concerning ourselves with infinite machines. – Yonatan N – 2014-01-10T22:31:53.200

This finally got beat by the dc operation below (right now far below). An absurd number of towers he has. – Joshua – 2014-01-13T01:24:39.267

So, how large would the output of this be?

– caird coinheringaahing – 2017-11-12T19:53:09.987

@cairdcoinheringaahing Somewhere around 10↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑(10^377) I think. That's 23 's. – Simply Beautiful Art – 2017-11-27T00:39:19.473

@KevinFegan Once the number has been generated it doesn't just magically float on your screen. That my friend is memory and anything a computer wants to output at any one time must be able to fit into it. – George Reith – 2014-01-18T15:14:12.150

Just to make it clear, in the third step, when you say "Now, let's repeat that 378-digit number a little over 10^377 times" you're already in the land of fantasy, because a common integer variable cannot store 10^377. So there is a limit to how many digits your program would print if left running for an unlimited time, and the limit is way below the score you computed. – Tobia – 2014-01-19T18:43:13.170

1

@Tobia: GolfScript integers are bignums, so in principle they have no size limit. That said, the reference interpreter, which is written in Ruby, does limit string length to less than 2^31 or 2^63 bytes (depending on platform), so you're right, that step is going to fail on the reference interpreter. That said, the string length limit is not part of the GolfScript spec (which, admittedly, is pretty vague), so it's arguably a bug in the interpreter rather than a fundamental limitation.

– Ilmari Karonen – 2014-01-19T19:39:28.553

@GeorgeReith - I don't know GolfScript programming syntax (at all), but my understandg is that the GolfScript code given will display the number as it's generating the number. If I'm wrong about that (perhaps someone can comment), and the code is trying to store the number in memory, then you are correct... it couldn't possibly store the entire number, at some point it would run out of memory. But, if it's displaying the number (in small groups of digits) as it's generating the (output) number, these displayed digits are constantly being discarded (scrolling away) and do not accumulate. – Kevin Fegan – 2014-01-19T21:55:01.767

@KevinFegan: It's storing the number. The usual way to output something in GolfScript is to just leave it on the stack when the program exits, and that's what my code does. GolfScript does have an explicit print command, but I'm not using it in any of the examples above. – Ilmari Karonen – 2014-01-19T22:00:51.590

42

JavaScript 44 chars

This may seem a little cheaty:

alert((Math.PI+''+Math.E).replace(/\./g,""))

Score = 31415926535897932718281828459045 / 44^3 ≈ 3.688007904758867e+26 ≈ 10↑↑2.1536134004

WallyWest

Posted 2014-01-08T23:13:21.950

Reputation: 6 949

9No rules bent at all: ;)

  • Can't use 0123456789 [check]

  • Use any language in which digits are valid characters; [check]

  • You can use mathematic/physic/etc. constants <10. [check, used 2]

  • Recursion is allowed but the generated number needs to be finite; [check, no recursion]

Can't use *, /, ^; [check]

Your program can output more than one number; [check]

You can concatenate strings; [check]

Your code will be run as-is; [check]

Max code length: 100 bytes; [check]

Needs to terminate w/i 5 sec [check] – WallyWest – 2014-01-09T23:45:26.110

Shave off 2 characters by passing "." to replace instead of /\./g – gengkev – 2014-01-12T21:10:14.057

1@gengkev Sadly, only using .replace(".","") only removes the first . character; I have to use the global replace to replace ALL . characters from the string... – WallyWest – 2014-01-12T23:55:12.040

You can do m=Math,p=m.PI,e=m.E,s="",alert((p*p*p+s+e*e*e).replace(/\./g,s)) instead, your score is then 3100627668029981620085536923187664 / 63^3 = 1.240017943838551e+28 – A.M.K – 2014-01-22T02:58:09.627

@A.M.K I could, but that would violate the rule *"You cannot use the operations , /, ^ nor any other way to indicate them (e.g. 2 div 2 is not allowed)" – WallyWest – 2014-01-22T03:36:40.287

@WallyWest Why even use Math.E when Math.PI is larger? p=Math.PI;(''+p+p+p+p).replace(/\./g,"") – Keen – 2014-06-13T21:15:00.567

1@Cory For one, I'm not going to repeat a constant, otherwise everyone would be using it... Second, I really don't have a second argument... – WallyWest – 2014-06-19T23:28:26.267

28

C, score = 101097.61735/983 ≈ 10↑↑2.29874984

unsigned long a,b,c,d,e;main(){while(++a)while(++b)while(++c)while(++d)while(++e)printf("%lu",a);}

I appreciate the help in scoring. Any insights or corrections are appreciated. Here is my method:

n = the concatenation of every number from 1 to 264-1, repeated (264-1)4 times. First, here's how I'm estimating (low) the cumulative number of digits from 1 to 264-1 (the "subsequence"): The final number in the subsequence sequence is 264-1 = 18446744073709551615 with 20 digits. Thus, more than 90% of the numbers in the subsequence (those starting with 1..9) have 19 digits. Let's assume the remaining 10% average 10 digits. It will be much more than that, but this is a low estimate for easy math and no cheating. That subsequence gets repeated (264-1)4 times, so the length of n will be at least (0.9×(264-1)×19 + 0.1×(264-1)×10) × (264-1)4 = 3.86613 × 1097 digits. In the comments below, @primo confirms the length of n to be 4.1433x1097. So n itself will be 10 to that power, or 101097.61735.

l = 98 chars of code

score = n/l3 = 101097.61735/983

Requirement: Must run on a 64-bit computer where sizeof(long) == 8. Mac and Linux will do it.

Darren Stone

Posted 2014-01-08T23:13:21.950

Reputation: 5 072

I'm sorry, I changed some specs after comment suggestions, you may want to review your solution. – Vereos – 2014-01-08T23:35:29.763

I checked. Thanks. I think it's fine. – Darren Stone – 2014-01-08T23:36:17.487

Oh, I see you added a new time limit. That would seem to favour golfers who have hardware that can scroll many digits to stdout very quickly. Was that your intent? – Darren Stone – 2014-01-08T23:42:37.513

The time limit has since been removed. – Timtech – 2014-01-09T00:31:49.387

2In C, 'z' is the constant value 122. Right? – primo – 2014-01-09T05:31:10.920

@primo, yes, 'z' is simply a literal character constant with char or int value of 122. man ascii was useful on the console! – Darren Stone – 2014-01-09T07:44:24.603

Global variables have an initial value of 0 in C. http://stackoverflow.com/questions/1597405/what-happens-to-a-declared-uninitialized-variable-in-c-does-it-have-a-value

– ntoskrnl – 2014-01-09T08:06:36.050

Would it be better to use uint64 instead of long, because long is signed, hence you've "only" 2^63-1 instead of 2^64-1 values for n? – klingt.net – 2014-01-09T09:39:47.517

@klingt.net, it should not matter. The while loop will see 2^64-1 iterations, regardless of sign. With a signed value, n gets progressively smaller (more negative), then wraps to maximum positive, then continues to decrease until it hits 0 and exits. – Darren Stone – 2014-01-09T09:53:55.107

1i think printf("%d",n) will make the number much larger. Also, 64-bit computer doesn't mean 64-bit longs, for example Windows use the LLP64 model so long is still 32 bits – phuclv – 2014-01-09T10:59:21.180

3it should not matter It does. Signed integer overflow is undefined behavior in C, so it's impossible to predict what will happen when your code is executed. It might violate the finitude requirement. – Dennis – 2014-01-09T14:55:01.310

@Lưu Vĩnh Phúc: I don't want to be a nit-picker, but he uses long n so print("%l",n) will be correct. :) – klingt.net – 2014-01-09T16:41:43.313

@LưuVĩnhPhúc, agreed, that's why I noted the requirement sizeof(long) == 8. It ran fine on 64-bit OS X and Linux. Too bad about Windows. I like your idea about the printf but I think that will only work with an unsigned long, otherwise many - chars will find their way into output. – Darren Stone – 2014-01-09T17:57:39.510

@klingt.net, good catch but it actually needs to be %ld since l is a modifier not a type specifier. – Darren Stone – 2014-01-09T18:07:32.303

%lu for unsigned long, and @klingt.net, uint64_t or another type would require a #include and add extra bytes. And digits in the source code. – tomlogic – 2014-01-09T18:32:42.220

If you sprintf instead of printf (or somehow otherwise store the digits), then atoi back into n and repeat the while loop, imagine... :-) (That's essentially what my answer does, 5 times.)

– Andrew Cheong – 2014-01-10T00:21:54.270

Thanks, I just improved the answer a bunch. I think it's similar to what you suggest. It does 5 nested loops, each of 2^64-1 iterations, and the inner loop is concatenating every integer from 1 to 2^64-1. Cheers. – Darren Stone – 2014-01-10T00:43:55.560

To (more) accurately calculate the length of your final number: make a copy of your program and use a method here and sum length of each (a) instead of printing (a), So something like: unsigned long a,b,c,d,e,f;main(){while(++a)while(++b)while(++c)while(++d)while(++e)f=f+lengthof(a);printf("%lu",f);} Well, it sounds like unsigned long f won't be big enough to hold the total accumulated length so a little more work is necessary to finish this.

– Kevin Fegan – 2014-01-11T02:54:31.303

Also, the scoring uses the value of the output-number for (n), not the number of digits in the output-number. If using number of digits to calculate score, then Score is (approximately): (number_of_digits)-log10(script_length^3). – Kevin Fegan – 2014-01-11T03:04:43.190

Good point. I will re-compute the score. – Darren Stone – 2014-01-11T03:06:17.003

1I think the analysis may be a bit off. The concatenation of 0..2^64-1 is exactly 357823770363079921190 digits long. Repeated (2^64-1)^4 times is 4.1433x10^97. Take 10 to that power is 10^10^97.61735 ≈ 10↑↑3.29875. I think you're claiming a power of ten you don't have (note where 3.866×10^97 became 3.866^10^97. – primo – 2014-01-15T16:06:41.167

2Hi @primo. Thanks for putting in the time to check this. Appreciate it. I see what you're saying. My final exponent is wrong. It should be 2.0 instead of 97. 10^10^10^2.00 = 10^10^97.6. I will reflect that in my score now. – Darren Stone – 2014-01-15T21:49:44.857

19

Python 3 - 99 chars - (most likely) significantly larger than Graham's number

I've come up with a more quickly increasing function based on an extension of the Ackermann function.

A=lambda a,b,*c:A(~-a,A(a,~-b,*c)if b else a,*c)if a else(A(b,*c)if c else-~b);A(*range(ord('~')))

http://fora.xkcd.com/viewtopic.php?f=17&t=31598 inspired me, but you don't need to look there to understand my number.

Here is the modified version of the ackermann function that I'll be using in my analysis:

A(b)=b+1
A(0,b,...)=A(b,...)
A(a,0,...)=A(a-1,1,...)
A(a,b,...)=A(a-1,A(a,b-1,...),...)

My function A in the code above is technically not the same, but it is actually stronger, with the following statement to replace the third line of the above definition:

A(a,0,...)=A(a-1,a,...)

(a has to be at least 1, so it has to be stronger)

But for my purposes I will assume that it is the same as the simpler one, because the analysis is already partially done for Ackermann's function, and therefore for this function when it has two arguments.

My function is guaranteed to eventually stop recursing because it always either: removes an argument, decrements the first argument, or keeps the same first argument and decrements the second argument.

Analysis of size

Graham's number, AFAIK, can be represented as G(64) using:

G(n) = g^n(4)
g(n) = 3 ↑^(n) 3

Where a ↑^(n) b is knuth's up-arrow notation.

As well:

A(a,b) = 2 ↑^(a-2) (b+3) - 3
A(a,0) ≈ 2 ↑^(a-2) 3
g(n) ≈ A(n+2,0) // although it will be somewhat smaller due to using 2 instead of 3. Using a number larger than 0 should resolve this.
g(n) ≈ A(n+2,100) // this should be good enough for my purposes.

g(g(n)) ≈ A(A(n+2,100),100)

A(1,a+1,100) ≈ A(0,A(1,a,100),100) = A(A(1,a,100),100)

g^k(n) ≈ A(A(A(A(...(A(n+2,100)+2)...,100)+2,100)+2,100)+2,100) // where there are k instances of A(_,100)
A(1,a,100) ≈ A(A(A(A(...(A(100+2),100)...,100),100),100),100)

g^k(100) ≈ A(1,k,100)
g^k(4) < A(1,k,100) // in general
g^64(4) < A(1,64,100)

The number expressed in the program above is A(0,1,2,3,4,...,123,124,125).

Since g^64(4) is Graham's number, and assuming my math is correct then it is less than A(1,64,100), my number is significantly larger than Graham's number.

Please point out any mistakes in my math - although if there aren't any, this should be the largest number computed so far to answer this question.

Cel Skeggs

Posted 2014-01-08T23:13:21.950

Reputation: 901

1Why did you do range(ord('~'))? Couldn't you have done range(125) for fewer bytes, which would allow you to squeeze in a higher number like range(A(9,9,9))? – Esolanging Fruit – 2016-12-29T17:20:50.060

1@Challenger5: rule 1 says "You cannot use digits in your code (0123456789)" – Cel Skeggs – 2016-12-29T21:49:35.393

@CelSkeggs: Oh, I forgot about that. – Esolanging Fruit – 2016-12-30T04:22:11.263

where does it print? – tuskiomi – 2017-05-18T15:56:58.920

Perhaps I know not how to do Python, but it doesn't appear to work: https://tio.run/##K6gsycjPM/7/39E2JzE3KSVRIVEnSUcr2cpRo043UcdRI1GnThckoJmZppCkkJpTnApUAeEmgrkajhow@WSwgG5dkqa1o4aR5v//AA

– Simply Beautiful Art – 2017-06-21T13:23:57.013

4

Looks great; apparently your "modified Ackermann" is exactly a Conway-chain evaluator.

– ceased to turn counterclockwis – 2014-01-13T11:27:28.980

1@leftaroundabout Not quite, but I think that it has about the same recursive strength. Also - zeroes aren't valid in chains, so you'll want to drop the zero from your Conway chain in the scores list. – Cel Skeggs – 2014-01-14T02:25:06.353

18

Perl - score &approx; 10↑↑4.1

$_=$^Fx($]<<-$]),/(?<R>(((((((((((((((((((.(?&R))*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*(??{print})/

Once again abusing perl's regex engine to grind through an unimaginable amount of combinations, this time using a recursive descent.

In the inner most of the expression, we have a bare . to prevent infinite recursion, and thus limiting the levels of recursion to the length of the string.

What we'll end up with is this:

/((((((((((((((((((((.[ ])*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*/
   ___________________/ \_____________________________________
  /                                                           \
  (((((((((((((((((((.[ ])*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*
   ___________________/ \_____________________________________
  /                                                           \
  (((((((((((((((((((.[ ])*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*
   ___________________/ \_____________________________________
  /                    .                                      \
                       .
                       .

... repeated 671088640 times, for a total of 12750684161 nestings - which quite thoroughly puts my previous attempt of 23 nestings to shame. Remarkably, perl doesn't even choke on this (once again, memory usage holds steady at about 1.3GB), although it will take quite a while before the first print statement is even issued.

From my previous analysis below, it can be concluded that the number of digits output will be on the order of (!12750684161)671088640, where !k is the Left Factorial of k (see A003422). We can approximate this as (k-1)!, which is strictly smaller, but on the same order of magnitude.

And if we ask wolframalpha:

...which barely changes my score at all. I thought for sure that'd be at least 10↑↑5. I guess the difference between 10↑↑4 and 10↑↑4.1 is a lot bigger than you'd think.


Perl - score &approx; 10↑↑4

$_=$^Fx($]<<-$]),/((((((((((((((((((((((.*.*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*)*(??{print})/

Abusing the perl regex engine to do some combinatorics for us. The embedded codeblock
(??{print}) will insert its result directly into the regex. Since $_ is composed entirely of 2s (and the result of print is always 1), this can never match, and sends perl spinning through all possible combinations, of which there's quite a few.

Constants used

  • $^F - the maximum system file handle, typically 2.
  • $] - the perl version number, similar to 5.016002.

$_ is then a string containing the digit 2 repeated 671088640 times. Memory usage is constant at about 1.3GB, output begins immediately.

Analysis

Let's define Pk(n) to be the number of times the print statement is executed, where k is the number of nestings, and n is the length of the string plus one (just because I don't feel like writing n+1 everywhere).

(.*.*)*
P2(n) = [2, 8, 28, 96, 328, 1120, 3824, 13056, ...]

((.*.*)*)*
P3(n) = [3, 18, 123, 900, 6693, 49926, 372615, 2781192, ...]

(((.*.*)*)*)*
P4(n) = [4, 56, 1044, 20272, 394940, 7696008, 149970676, 2922453344, ...]

((((.*.*)*)*)*)*
P5(n) = [5, 250, 16695, 1126580, 76039585, 5132387790, 346417023515, 23381856413800, ...]

(((((.*.*)*)*)*)*)*
P6(n) = [6, 1452, 445698, 137050584, 42142941390, 12958920156996, ...]

((((((.*.*)*)*)*)*)*)*
P7(n) = [7, 10094, 17634981, 30817120348, 53852913389555, ...]

etc. In general, the formula can be generalized as the following:

where

That is, the Left Factorial of k, i.e. the sum of all factorials less than k (see A003422).


I've been unable to determine closed forms for Dk and Ek, but this doesn't matter too much, if we observe that

and

With 23 nestings, this gives us an approximate score of:

This should be nearly exact, actually.

But to put this into a notation that's a bit easier to visualize, we can approximate the base of the inner exponent:

and then the exponent itself:

and then ask wolframalpha:

which you may as well just call 10↑↑4 and be done with it.

primo

Posted 2014-01-08T23:13:21.950

Reputation: 30 891

1So, this will only be a valid solution so long as the version number remains lower than 10? – Mr Lister – 2014-01-09T14:38:52.667

3@MrLister Yes. Fortunately, no major version higher than 6 exists, and even that's not considered to be fully 'ready', despite having been originally announced in 2000. – primo – 2014-01-09T14:43:19.607

@primo You do realize that you will have to revise this answer once Perl goes into a version number > 10, right? ;) – WallyWest – 2014-01-10T03:10:30.957

3@Eliseod'Annunzio If I'm still alive when that day arrives - if ever - I promise to come back and fix it. – primo – 2014-01-10T08:19:16.600

My brain hurts after reading the errr... wotsit symbologies... :D – t0mm13b – 2014-01-17T00:43:01.913

2A running solution that surpasses 10↑↑4. That's impressive. Bravo! – Tobia – 2014-01-19T20:16:12.907

16

Javascript, 10↑↑↑↑210

100 chars:

z=~~Math.E+'';o={get f(){for(i=z;i--;)z+=i}};o.f;for(i=z;i--;)for(j=z;j--;)for(k=z;k--;)o.f;alert(z)

Based on the observation that maximally iterating f is the optimal way to go, I replaced the 13 calls to f with 3 levels of nested loops calling f, z times each (while f keeps increasing z).

I estimated the score analytically on a piece of paper—I'll type it up if anyone is interested in seeing it.


Improved Score: 10↑↑13

Javascript, in exactly 100 characters, again:

z=~~Math.E+'';__defineGetter__('f',function(){for(i=z;i--;)z+=i});f;f;f;f;f;f;f;f;f;f;f;f;f;alert(z)

This improves my original answer in three ways—

  1. Defining z on the global scope saves us from having to type o.z each time.

  2. It's possible to define a getter on the global scope (window) and type f instead of o.f.

  3. Having more iterations of f is worth more than starting with a larger number, so instead of (Math.E+'').replace('.','') (=2718281828459045, 27 chars), it's better to use ~~Math.E+'' (=2, 11 chars), and use the salvaged characters to call f many more times.

Since, as analyzed further below, each iteration produces, from a number in the order of magnitude M, a larger number in the order of magnitude 10M, this code produces after each iteration

  1. 210 ∼ O(102)
  2. O(10102) ∼ O(10↑↑2)
  3. O(1010↑↑2) = O(10↑↑3)
  4. O(1010↑↑3) = O(10↑↑4)
  5. O(1010↑↑4) = O(10↑↑5)
  6. O(1010↑↑5) = O(10↑↑6)
  7. O(1010↑↑6) = O(10↑↑7)
  8. O(1010↑↑7) = O(10↑↑8)
  9. O(1010↑↑8) = O(10↑↑9)
  10. O(1010↑↑9) = O(10↑↑10)
  11. O(1010↑↑10) = O(10↑↑11)
  12. O(1010↑↑11) = O(10↑↑12)
  13. O(1010↑↑12) = O(10↑↑13)

Score: ∼101010101016 ≈ 10↑↑6.080669764

Javascript, in exactly 100 characters:

o={'z':(Math.E+'').replace('.',''),get f(){i=o.z;while(i--){o.z+=i}}};o.f;o.f;o.f;o.f;o.f;alert(o.z)

Each o.f invokes the while loop, for a total of 5 loops. After only the first iteration, the score is already over 1042381398144233621. By the second iteration, Mathematica was unable to compute even the number of digits in the result.

Here's a walkthrough of the code:

Init

Start with 2718281828459045 by removing the decimal point from Math.E.

Iteration 1

Concatenate the decreasing sequence of numbers,

  • 2718281828459045
  • 2718281828459044
  • 2718281828459043
  • ...
  • 3
  • 2
  • 1
  • 0

to form a new (gigantic) number,

  • 271828182845904527182818284590442718281828459043...9876543210.

How many digits are in this number? Well, it's the concatenation of

  • 1718281828459046 16-digit numbers
  • 900000000000000 15-digit numbers
  • 90000000000000 14-digit numbers,
  • 9000000000000 13-digit numbers
  • ...
  • 900 3-digit numbers
  • 90 2-digit numbers
  • 10 1-digit numbers

In Mathematica,

In[1]:= 1718281828459046*16+Sum[9*10^i*(i+1),{i,-1,14}]+1
Out[1]= 42381398144233626

In other words, it's 2.72⋅1042381398144233625.

Making my score, after only the first iteration, 2.72⋅1042381398144233619.

Iteration 2

But that's only the beginning. Now, repeat the steps, starting with the gigantic number! That is, concatenate the decreasing sequence of numbers,

  • 271828182845904527182818284590442718281828459043...9876543210
  • 271828182845904527182818284590442718281828459043...9876543209
  • 271828182845904527182818284590442718281828459043...9876543208
  • ...
  • 3
  • 2
  • 1
  • 0

So, what's my new score, Mathematica?

In[2]:= 1.718281828459046*10^42381398144233624*42381398144233625 + Sum[9*10^i*(i + 1), {i, -1, 42381398144233623}] + 1

During evaluation of In[2]:= General::ovfl: Overflow occurred in computation. >>

During evaluation of In[2]:= General::ovfl: Overflow occurred in computation. >>

Out[2]= Overflow[]

Iteration 3

Repeat.

Iteration 4

Repeat.

Iteration 5

Repeat.


Analytical Score

In the first iteration, we calculated the number of digits in the concatenation of the decreasing sequence starting at 2718281828459045, by counting the number of digits in

  • 1718281828459046 16-digit numbers
  • 900000000000000 15-digit numbers
  • 90000000000000 14-digit numbers,
  • 9000000000000 13-digit numbers
  • ...
  • 900 3-digit numbers
  • 90 2-digit numbers
  • 10 1-digit numbers

This sum can be represented by the formula,

        enter image description here

where Z denotes the starting number (e.g. 2718281828459045) and OZ denotes its order of magnitude (e.g. 15, since Z ∼ 1015). Using equivalences for finite sums, the above can be expressed explicitly as

        enter image description here

which, if we take 9 ≈ 10, reduces even further to

        enter image description here

and, finally, expanding terms and ordering them by decreasing order of magnitude, we get

        enter image description here

Now, since we're only interested in the order of magnitude of the result, let's substitute Z with "a number in the order of magnitude of OZ," i.e. 10OZ

        enter image description here

Finally, the 2nd and 3rd terms cancel out, and the last two terms can be dropped (their size is trivial), leaving us with

        enter image description here

from which the first term wins out.

Restated, f takes a number in the order of magnitude of M and produces a number approximately in the order of magnitude of M(10M).

The first iteration can easily be checked by hand. 2718281828459045 is a number in the order of magnitude of 15—therefore f should produce a number in the order of magnitude of 15(1015) ∼ 1016. Indeed, the number produced is, from before, 2.72⋅1042381398144233625—that is, 1042381398144233625 ∼ 101016.

Noting that M is not a significant factor in M(10M), the order of magnitude of the result of each iteration, then, follows a simple pattern of tetration:

  1. 1016
  2. 101016
  3. 10101016
  4. 1010101016
  5. 101010101016

LaTeX sources

(Z-10^{\mathcal{O}_Z}+1)(\mathcal{O}_Z+1)+\sum_{k=0}^{\mathcal{O}_Z-1}{(9\cdot10^k(k+1))}+1

(Z-10^{\mathcal{O}_Z}+1)(\mathcal{O}_Z+1)+\frac{10-\mathcal{O}_Z10^{\mathcal{O}_Z}+(\mathcal{O}_Z-1)10^{\mathcal{O}_Z+1}}{9}+10^{\mathcal{O}_Z}

(Z-10^{\mathcal{O}_Z}+1)(\mathcal{O}_Z+1)+\mathcal{O}_Z10^{\mathcal{O}_Z}-\mathcal{O}_Z10^{\mathcal{O}_Z-1}+1

Z\mathcal{O}_Z+Z-10^{\mathcal{O}_Z}-\mathcal{O}_Z10^{\mathcal{O}_Z-1}+\mathcal{O}_Z+2

\mathcal{O}_Z10^{\mathcal{O}_Z}+10^{\mathcal{O}_Z}-10^{\mathcal{O}_Z}-\mathcal{O}_Z10^{\mathcal{O}_Z-1}+\mathcal{O}_Z+2

\mathcal{O}_Z10^{\mathcal{O}_Z}-\mathcal{O}_Z10^{\mathcal{O}_Z-1}

Andrew Cheong

Posted 2014-01-08T23:13:21.950

Reputation: 405

My reckoning about your score is based on the observation that f does something like take the number z to its own power. So that's something like ↑↑↑. Of course the score is not 2↑↑↑2, sorry... more like, 2↑↑↑5+1 it seems. Would you agree, should I put that in the leaderboard? – ceased to turn counterclockwis – 2014-01-10T02:33:12.527

@leftaroundabout - Thanks for looking into it again. I don't feel comfortable enough with up-arrow notation to say whether your suggestion sounds right or not, but I calculated the order of magnitude of my score (see edit) if you'd like to update the leaderboard with that. – Andrew Cheong – 2014-01-10T08:07:45.337

Excellent! I'm not at all firm with up-arrows either. So actually you have "only" a tower of power; I'm afraid that places you two spots lower in the ranking. Kudos for properly analysing the result; my estimations have probably yet more flaws in them, but I felt someone should at least try to get some order in the answers. – ceased to turn counterclockwis – 2014-01-10T09:35:17.307

@leftaroundabout - No worries, fair is fair. I made some improvements though (see edit) to bring my score to 10↑↑13. And yes, I was hoping someone would at least attempt to verify and order the lot of these answers, so I appreciate your work, and I'm sure others do too. – Andrew Cheong – 2014-01-10T11:07:25.013

@leftaroundabout - One last update, please :-) The new score is 10↑↑↑↑210. Well, actually, it's 10↑↑(10↑↑↑↑210)—but it appears that for such large numbers, larger "forests" on the inside "override" smaller forests on the outside. Take, for example, 10↑(10↑↑200). This is essentially 10^(10^...^10) 200 times, which is simply 10↑↑201—not much different from 10↑↑200. Thus, though I don't mean to knock his answer, I believe Kendall Frey's score is essentially in the order of magnitude of 3 ↑↑↑↑ 3, the 10^ being trivial. – Andrew Cheong – 2014-01-10T13:25:23.777

Shouldn't the code be able to be executed? – Danubian Sailor – 2014-01-10T18:23:15.290

@ŁukaszL. - The code should execute—given ample (seriously ample) time and memory—the loops are finite—and Javascript doesn't have a maximum string length. If I'm wrong though, please let me know! – Andrew Cheong – 2014-01-10T18:41:34.480

Well, it can't use more memory as you have, and the browser will probably crash much earlier. The question is, if you have really executed that code on any computer. After removing 5 second limitation, the task is going madness anyway... – Danubian Sailor – 2014-01-10T18:57:44.953

@ŁukaszL. - But I think that's true of all the top-ranked answers... You can't really print any of these numbers to screen (while keeping hidden digits in memory). – Andrew Cheong – 2014-01-10T19:23:00.447

1Your score is wrong. Whenever you start a loop with i=o.z;while(i--)... you are not executing the loop o.z times, because a loop is based on an integer variable and o.z contains a string larger than the largest representable integer, depending on your interpreter's word size. Supposing for your benefit that your interpreter won't barf on converting such a string to int, i will start each time with its largest representable integer value, let's say 2^63, and not with the current value of o.z. – Tobia – 2014-01-10T21:34:05.967

@Tobia - Ah, you're correct. I thought JS was keeping the string a string during assignment and simply juggled types to decrement when asked to—but even so, I should have realized, it would have to convert the string to a number in order to decrement (unless it does so typographically). I guess this disqualifies my answer—I'll remove myself from the list. – Andrew Cheong – 2014-01-11T10:53:25.577

I don't know enough about JavaScript to judge this... for small numbers, decrementing this way would work, wouldn't it? We've long thrown out "real-word restrictions" anyway, so I think your submission might still be ok. – ceased to turn counterclockwis – 2014-01-11T13:06:50.437

2@acheong87 Don't remove yourself, you just have to recompute your score, capping the loop variables to 2^63 or such. PS: leave your analytical score posted here, it's very instructive! – Tobia – 2014-01-11T16:06:45.583

15

APL, 10↑↑3.4

Here's my revised attempt:

{⍞←⎕D}⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⍣n⊢n←⍎⎕D

100 char/byte* program, running on current hardware (uses a negligible amount of memory and regular 32-bit int variables) although it will take a very long time to complete.

You can actually run it on an APL interpreter and it will start printing digits. If allowed to complete, it will have printed a number with 10 × 12345678944 digits.

Therefore the score is 1010 × 12345678944 / 1003 ≈ 1010353 ≈ 10↑↑3.406161

Explanation

  • ⎕D is a predefined constant string equal to '0123456789'
  • n←⍎⎕D defines n to be the number represented by that string: 123456789 (which is < 231 and therefore can be used as a loop control variable)
  • {⍞←⎕D} will print the 10 digits to standard output, without a newline
  • {⍞←⎕D}⍣n will do it n times ( is the "power operator": it's neither *, /, nor ^, because it's not a math operation, it's a kind of loop)
  • {⍞←n}⍣n⍣n will repeat the previous operation n times, therefore printing the 10 digits n2 times
  • {⍞←n}⍣n⍣n⍣n will do it n3 times
  • I could fit 44 ⍣n in there, so it prints n44 times the string '0123456789'.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
*: APL can be written in its own (legacy) single-byte charset that maps APL symbols to the upper 128 byte values. Therefore, for the purpose of scoring, a program of N chars that only uses ASCII characters and APL symbols can be considered to be N bytes long.

Tobia

Posted 2014-01-08T23:13:21.950

Reputation: 5 455

1@ToastyMallows Read the end notes on the answer. – Simply Beautiful Art – 2017-05-17T13:25:41.343

Your printed number will be divided for the number of bytes you used for your solution^3., you're dividing by 100 right now. – ToastyMallows – 2014-01-09T18:30:57.147

2@ToastyMallows - looks like 100 cubed (100^3) to me. – Kevin Fegan – 2014-01-09T19:36:43.960

1I know but it's bytes, not characters. – ToastyMallows – 2014-01-09T20:03:20.927

Change {⍞←⎕D} to ⍞← which saves you three bytes that you can use to add one more ⍣n and make ⊢n←⍎⎕D into ⌽⍕n←⍎⎕D for an 80-fold increase. If you allow running with ⎕PP←17 then use ×⍨ instead of ⌽⍕ which almost doubles the number of digits printed. – Adám – 2019-01-15T12:51:20.430

12

Haskell, score: (22265536-3)/1000000 ≈ 2↑↑7 ≈ 10↑↑4.6329710779

o=round$sin pi
i=succ o
q=i+i+i+i
m!n|m==o=n+i
 |n==o=(m-i)!i
 |True=(m-i)!(m!(n-i))
main=print$q!q

This program is exactly 100 bytes of pure Haskell code. It will print the fourth Ackermann number, eventually consuming all available energy, matter and time of the Universe and beyond in the process (thus slightly exceeding the soft limit of 5 seconds).

n. 'pronouns' m.

Posted 2014-01-08T23:13:21.950

Reputation: 346

o=length[] gets you an extra !q at the end and saves you a byte on top of that. – Khuldraeseth na'Barya – 2019-07-01T21:56:08.913

9

Python, 2↑↑11 / 830584 ≈ 10↑↑8.632971 (Knuth up arrow notation)

print True<<(True<<(True<<(True<<(True<<(True<<(True<<(True<<(True<<(True<<True<<True)))))))))

Probably no computer has enough memory to successfully run this, but that's not really the program's fault. With the minimum system requirements satisfied, it does work.

Yes, this is doing bit shifting on boolean values. True gets coerced to 1 in this context. Python has arbitrary length integers.

recursive

Posted 2014-01-08T23:13:21.950

Reputation: 8 616

1Better yet, just make a loop that does these nestings for you. – Simply Beautiful Art – 2017-05-14T00:24:49.577

This fails for me: $python -c 'print True<<(True<<(True<<(True<<(True<<(True<<(True<<(True<<(True<<(True<<True<<True)))))))))' Traceback (most recent call last): File "<string>", line 1, in <module> OverflowError: long int too large to convert to int – Brian Minton – 2017-05-19T13:17:18.740

I guess it might be a different python version. – recursive – 2017-05-19T14:17:00.100

Your code doesn't run. Only print True<<(True<<(True<<(True<<True<<True))) does, and that outputs a 19k string. – Gabe – 2014-01-09T22:56:03.107

What are that minimum system requirements? – Danubian Sailor – 2014-01-10T10:15:03.050

8Could you not make it shorter by defining t=True and then using t after? – Bob – 2014-01-16T12:51:21.057

8

GolfScript 3.673e+374

'~'(.`*

I think the * is allowed since it indicates string repetition, not multiplication.

Explanation: '~'( will leave 126 (the ASCII value of "~") on the stack. Then copy the number, convert it to a string, and do string repetition 126 times. This gives 126126126126... which is approximately 1.26 e+377. The solution is 7 characters, so divide by 7^3, for a score of approximately 3.673e+374

Ben Reich

Posted 2014-01-08T23:13:21.950

Reputation: 1 577

7

dc, 100 characters

[lnA A-=ilbA A-=jlaSalbB A--SbLndB A--SnSnlhxlhx]sh[LaLnLb1+sbq]si[LbLnLasbq]sjFsaFsbFFFFFFsnlhxclbp

Given enough time and memory, this will calculate a number around 15 ↑¹⁶⁶⁶⁶⁶⁵ 15. I had originally implemented the hyperoperation function, but it required too many characters for this challenge, so I removed the n = 2, b = 0 and n >= 3, b = 0 conditions, turning the n = 1, b = 0 condition into n >= 1, b = 0.

The only arithmetic operators used here are addition and subtraction.

EDIT: as promised in comments, here is a breakdown of what this code does:

[            # start "hyperoperation" macro
lnA A-=i     # if n == 0 call macro i
lbA A-=j     # if b == 0 call macro j
laSa         # push a onto a's stack
lbB A--Sb    # push b-1 onto b's stack
LndB A--SnSn # replace the top value on n with n-1, then push n onto n's stack
lhxlhx       # call macro h twice
]sh          # store this macro in h

[            # start "increment" macro (called when n=0, the operation beneath addition)
LaLnLb       # pop a, b, and n
F+sb         # replace the top value on b with b+15
q            # return
]si          # store this macro in i

[            # start "base case" macro (called when n>0 and b=0)
LbLnLa       # pop b, n, and a
sb           # replace the top value on b with a
q            # return
]sj          # store this macro in j

Fsa          # store F (15) in a
Fsb          # store F (15) in b
FFFFFFsn     # store FFFFFF "base 10" (150000+15000+1500+150+15=1666665) in n
lhx          # load and call macro h
lbp          # load and print b

As noted, this deviates from the hyperoperation function in that the base cases for multiplication and higher are replaced with the base case for addition. This code behaves as though a*0 = a^0 = a↑0 = a↑↑0 ... = a, instead of the mathematically correct a*0 = 0 and a^0 = a↑0 = a↑↑0 ... = 1. As a result, it computes values that are a bit higher than they should be, but that's not a big deal since we are aiming for bigger numbers. :)

EDIT: I just noticed that a digit slipped into the code by accident, in the macro that performs increments for n=0. I've removed it by replacing it with 'F' (15), which has the side effect of scaling each increment operation by 15. I'm not sure how much this affects the final result, but it's probably a lot bigger now.

Fraxtil

Posted 2014-01-08T23:13:21.950

Reputation: 2 495

I have no idea what this code does... can only assume it's correct. Perhaps you could explain a little? – ceased to turn counterclockwis – 2014-01-10T12:27:31.977

I'll explain the code piece by piece when I have time later tonight. – Fraxtil – 2014-01-10T18:14:12.707

Well, I spaced on that explanation, but I've added it now. Hope it clears things up. – Fraxtil – 2014-01-13T04:28:55.590

dc-1.06.95-2 terminates immediately, having printed nothing. – primo – 2014-01-16T17:05:38.157

1I wouldn't expect it to work on any existing machine, given the magnitude of the value it will try to generate. I have the same version of dc and it segfaults after a few seconds. I'm assuming "theoretically correct" answers are permitted here, since there's no criteria for resource consumption. – Fraxtil – 2014-01-16T19:16:27.007

7

GolfScript,   &approx; fε0(fε0(fε0(fε0(fε0(fε0(fε0(fε0(fε0(126)))))))))

This is shamelessly adapted from another answer by @Howard, and incorporates suggestions by @Peter Taylor.

[[[[[[[[[,:o;'~'(]{o:?~%{(.{[(]{:^o='oo',$o+o=<}{\(@\+}/}{,:^}if;^?):?)*\+.}do;?}:f~]f]f]f]f]f]f]f]f

My understanding of GolfScript is limited, but I believe the * and ^ operators above are not the arithmetic operators forbidden by the OP.

(I will happily delete this if @Howard wants to submit his own version, which would doubtless be superior to this one anyway.)

This program computes a number that's approximately fε0(fε0(fε0(fε0(fε0(fε0(fε0(fε0(fε0(126))))))))) -- a nine-fold iteration of fε0 -- where fε0 is the function in the fast-growing hierarchy that grows at roughly the same rate as the Goodstein function. (fε0 grows so fast that the growth rates of Friedman's n(k) function and of k-fold Conway chained arrows are virtually insignificant even in comparison to just a single non-iterated fε0.)

r.e.s.

Posted 2014-01-08T23:13:21.950

Reputation: 2 872

Ha... scrolling these answers, and then I see this... and then I notice the accepted answer... hm...... – Simply Beautiful Art – 2017-05-13T14:13:25.097

@SimplyBeautifulArt I'm not sure what you mean, but the accepted answer does compute a very much larger number than this one (assuming both are as claimed). – r.e.s. – 2017-05-14T03:30:43.840

Heh, just the gap kinda goes from ω level to this, kind of a jump. – Simply Beautiful Art – 2017-05-14T11:18:55.053

Jesus what the... I'm beginning to learn some GolfScript... and this just... I am speechless. – Simply Beautiful Art – 2017-05-17T16:59:08.293

'',:o;'oo',:t; just assigns the values 0 to o and 2 to t; if that's just to work around lack of digits then it can be abbreviated heavily to ,:o)):t;, except that there's no reason to delete t in the first place because you can write expr:t;{...}:f;[[[t]f]f]f as [[[expr:t]{...}:f~]f]f saving a further 3 chars. – Peter Taylor – 2014-01-20T00:26:37.917

Still no need to pop o: I'm pretty sure that [0 126]f will be one larger than [126]f so you save a char and bump the output. Although you're leaving an empty string in there, which probably breaks things: it might be better to start [[,:o'~'=] – Peter Taylor – 2014-01-20T08:44:03.100

Oh, and the [ are unnecessary since you don't have anything else on the stack. – Peter Taylor – 2014-01-20T10:39:57.277

6

No more limit on runtime? OK then.

Does the program need to be runnable on modern computers?

Both solutions using a 64-bit compile, so that long is a 64-bit integer.

C: greater than 10(264-1)264, which is itself greater than 1010355393490465494856447 ≈ 10↑↑4.11820744

long z;void f(long n){long i=z;while(--i){if(n)f(n+~z);printf("%lu",~z);}}main(){f(~z);}

88 characters.

To make these formulas easier, I'll use t = 2^64-1 = 18446744073709551615.

main will call f with a parameter of t, which will loop t times, each time printing the value t, and calling f with a parameter of t-1.

Total digits printed: 20 * t.

Each of those calls to f with a parameter of t-1 will iterate t times, printing the value t, and calling f with a parameter of t-2.

Total digits printed: 20 * (t + t*t)

I tried this program using the equivalent of 3-bit integers (I set i = 8 and had main call f(7)). It hit the print statement 6725600 times. That works out to 7^8 + 7^7 + 7^6 + 7^5 + 7^4 + 7^3 + 7^2 + 7 Therefore, I believe that this is the final count for the full program:

Total digits printed: 20 * (t + t*t + t^3 + ... + t^(t-1) + t^t + t^(2^64))

I'm not sure how to calculate (264-1)264. That summation is smaller than (264)264, and I need a power of two to do this calculation. Therefore, I'll calculate (264)264-1. It's smaller than the real result, but since it's a power of two, I can convert it to a power of 10 for comparison with other results.

Does anyone know how to perform that summation, or how to convert (264-1)264 to 10n?

20 * 2^64^(2^64-1)
20 * 2^64^18446744073709551615
20 * 2^(64*18446744073709551615)
20 * 2^1180591620717411303360
10 * 2^1180591620717411303361
divide that exponent by log base 2 of 10 to switch the base of the exponent to powers of 10.
1180591620717411303361 / 3.321928094887362347870319429489390175864831393024580612054756 = 
355393490465494856446
10 * 10 ^ 355393490465494856446
10 ^ 355393490465494856447

But remember, that's the number of digits printed. The value of the integer is 10 raised to that power, so 10 ^ 10 ^ 355393490465494856447

This program will have a stack depth of 2^64. That's 2^72 bytes of memory just to store the loop counters. That's 4 Billion Terabytes of loop counters. Not to mention the other things that would go on the stack for 2^64 levels of recursion.

Edit: Corrected a pair of typos, and used a more precise value for log2(10).

Edit 2: Wait a second, I've got a loop that the printf is outside of. Let's fix that. Added initializing i.

Edit 3: Dang it, I screwed up the math on the previous edit. Fixed.


This one will run on modern computers, though it won't finish any time soon.

C: 10^10^136 ≈ 10↑↑3.329100567

#define w(q) while(++q)
long a,b,c,d,e,f,g,x;main(){w(a)w(b)w(c)w(d)w(e)w(f)w(g)printf("%lu",~x);}

98 Characters.

This will print the bitwise-inverse of zero, 2^64-1, once for each iteration. 2^64-1 is a 20 digit number.

Number of digits = 20 * (2^64-1)^7 = 14536774485912137805470195290264863598250876154813037507443495139872713780096227571027903270680672445638775618778303705182042800542187500

Rounding the program length to 100 characters, Score = printed number / 1,000,000

Score = 10 ^ 14536774485912137805470195290264863598250876154813037507443495139872713780096227571027903270680672445638775618778303705182042800542187494

David Yaw

Posted 2014-01-08T23:13:21.950

Reputation: 931

Maybe. %u was printing 32-bit numbers even with a 64-bit compile, so I just did the ll out of habit from writing in a 32-bit compiler. – David Yaw – 2014-01-09T19:28:45.217

I think %llu would be for long long, and %lu would be correct for long. – tomlogic – 2014-01-09T20:12:54.483

Fixed. Force of habit: %u is always 32-bit, %llu is always 64-bit, whether compiling as 32 or 64 bit. However, the solution here requires that long be 64-bit, so you're right, %lu is sufficient. – David Yaw – 2014-01-09T20:42:21.883

Your variables on the stack are not guaranteed to be initialized to 0. In the second program, just put them outside of any function. In the first one, you'll have to initialize i. – Art – 2014-01-10T12:39:53.143

Also, long overflow is undefined behavior and many modern compilers will just optimize it away if they detect it, you probably want to use unsigned long. – Art – 2014-01-10T12:41:58.763

Added initializing i. I can't switch to unsigned long, adding the word unsigned makes it longer than the 100 character limit. – David Yaw – 2014-01-10T17:57:08.387

6

Ruby, probabilistically infinite, 54 characters

x='a'.ord
x+=x while x.times.map(&:rand).uniq[x/x]
p x

x is initialized to 97. We then iterate the following procedure: Generate x random numbers between 0 and 1. If they are all the same, then terminate and print x. Otherwise, double x and repeat. Since Ruby's random numbers have 17 digits of precision, the odds of terminating at any step are 1 in (10e17)^x. The probability of terminating within n steps is therefore the sum for x=1 to n of (1/10e17)^(2^n), which converges to 1/10e34. This means that for any number, no matter how large, it is overwhelmingly unlikely that this program outputs a lesser number.

Now, of course, the philosophical question is whether a program that has less than a 1 in 10^34 chance of terminating by step n for any n can be said to ever terminate. If we assume not only infinite time and power, but that the program is given the ability to run at increasing speed at a rate that exceeds the rate at which the probability of terminating decreases, we can, I believe, in fact make the probability of terminating by time t arbitrarily close to 1.

histocrat

Posted 2014-01-08T23:13:21.950

Reputation: 20 600

3this depends on the number generator which in most languages is unlikely be able to generate 97 times the same number – ratchet freak – 2014-01-10T15:00:01.110

1Good point, so in addition to assuming continually rapidly increasing computation power, I also need to assume a perfect source of randomness and a Ruby implementation that uses it. – histocrat – 2014-01-10T19:09:23.707

5

New Ruby: score ~ fωω2+1(12622126)

where fα(n) is the fast growing hierarchy.

n=?~.ord;H=->a{b,*c=a;eval"b ?H[b==$.?c:[b==~$.?n:b-(b<=>$.)]*n+c]:p(n+=n);"*n};eval"H[~n];".*n*n<<n

Try it online!

The *n are just string and array multiplication, so they should be fine.

Ungolfed code:

n = 126
H =-> a {
    b, *c = a
    n.times{
        case b
        when nil
            puts(n += n)
        when 0
            H[c]
        when -1
            H[[n]*n+c]
        else
            H[[b.-b<=>0]*n+c]
        end
    }
}
(n*n<<n).times{H[~n]}

where b.-b<=>0 returns an integer that is 1 closer to 0 than b.


Explanation:

It prints n at the start of every call of H.

H[[]] doubles n (n times), i.e. n = n<<n.

H[[0,a,b,c,...,z]] calls H[[a,b,c,...,z]] (n times).

H[[k+1,a,b,c,...,z]] calls H[[k]*n+[a,b,c,...,z]] (n times), where [k]*n = [k,k,...,k].

H[[-1,a,b,c,...,z]] calls H[[n]*n+[a,b,c,...,z]] (n times).

H[[-(k+1),a,b,c,...,z]] calls H[[-k]*n+[a,b,c,...,z]] (n times).

H[k] = H[[k]].

My program initializes n = 126, then calls H[-n-1] 12622126 times.


Examples:

H[[0]] will call H[[]] which applies n = n<<n (n times).

H[[0,0]] will call H[[0]] (n times).

H[[1]] will call H[[0]*n] (n times).

H[[-1]] will call H[[n]*n] (n times).

H[[-1,-1]] will call H[[n]*n+[-1]] (n times).

H[[-3]] will call H[[-2]*n] (n times).

Try it online!


See revisions for other cool things.

Simply Beautiful Art

Posted 2014-01-08T23:13:21.950

Reputation: 2 140

Let us continue this discussion in chat.

– HyperNeutrino – 2017-05-12T14:35:06.997

It's actually 103 bytes, you had a trailing newline I think. – Rɪᴋᴇʀ – 2017-05-13T14:37:16.200

@Riker I believe you copied and pasted from here. Note there should be an unprintable character on the second line, hence 104 bytes. – Simply Beautiful Art – 2017-05-13T14:42:21.117

@SimplyBeautifulArt ah, okay. I thought I copied the character. Sorry. – Rɪᴋᴇʀ – 2017-05-13T14:43:31.390

@Riker Nah, its not even there due to Stackexchange not letting me hide invisible characters everywhere. – Simply Beautiful Art – 2017-05-13T14:47:19.800

5

Ruby, fφω(ω)(65535)

Deterministic program:

h=n=?~.ord,[],n
f=->a{b,c,d=a;b ?a==b ?~-a:a==a-[$.]?[[b,c,f[d]],f[c],b]:b:n+=n}
h=f[h]while h[$.]

Try it online!

Note that the ~ needs to be replaced with a special character (see TIO link).

Ungolfed: (with numbers and commentary)

n = 126          # declare n
h = [n,[],n]     # declare h
f = -> a{        # declare f
    b,c,d = a    # declare b,c,d
    if !b.nil?           # if a != []
        if a == b            # if a is an integer
            return a-1
        elsif a==a-[0]       # if a does not contain 0.
            t = [b,c,f[d]]
            return [t,f[c],b]
        else                 # if a does contain 0.
            return b
        end
    else                 # if a == [].
        n += n
        return n
    end
}
until h == n do  # test if h == n.
    h = f[h]     # reduce h.
    p(n)
end

Math explanation:

For simplicity, let g[h,n] be a function which declares h and n and then runs the second two lines of my program, replacing the last line with (p(n+=n);h=f[h])until h==0 and ending the second line with n instead of n+=n. (The resulting function grows slightly faster, though not by a significant amount (g[h,n] ~ g'[[[],2,h],n], where g' uses my actual program.))

Try it online!

g[0,n] = n
g[h,n] = g[f[h],n*2]

For integer k, we have

f[k] = k-1
g[k,n] = g[k-1,n*2] = g[k-2,n*4] = ... = n*2^k = n<<k (bitwise shift)

Next, we have [], our transfinite ordinal:

f[[]] = n
g[[],n] = g[n*2,n*2] = n*2^(1+n*2) = n<<(1+n<<1)

Next, we have successor ordinals (i.e. f[x+1] = x):

# Choice of y does not make any difference.
f[[x,0,y]] = x
g[[[],0,0],n] = g[[],n*2] = g[n*4,n*4] = n*2^(2+n*4) = n<<(2<<n<<2)
g[[[[],0,0],0,0],n] = g[[[],0,0],n*2] = g[[],n*4] = g[n*8,n*8] = n*2^(3+n*8) = n<<(3+n<<3)

Then we have addition (i.e. f[x+y] = x+f[y]+1)

f[[x,1,y]] = [[x,1,f[y]],0,x]
f[[x,1,0]] = x
g[[[],1,[]],n] = g[[[[],1,n*2],0,[]],n*2] = g[[[],1,n*2],n*4] = g[[[[],1,n*2-1],1,[]],n*8] = g[[[],1,n*2-1],n*16] = ... = g[[[],1,0],n*2^(2+n*4)] = g[[],n*2^(3+n*4)] = n*2^(4+n*4+n*2^(4+n*4))

And we can go on with expressions like [[],1,[[],1,[]]] or even more nestings. You'll notice that n nestings of [] inside of [[],1,...] will lead to n levels of n*2^n. This let's us quickly approximate a lower bound:

g[[[],1,[[],1,[[],1,[[],1,[]]]]],n] > n*2^(n*2^(n*2^(n*2^(n*2^n))))

This brings us to the generalized hyperoperator:

f[[x,y,z]] = [[x,y,f[z]],f[y],x]
f[[x,y,0]] = x
f[[x,0,z]] = x
f[[0,y,z]] = 0

This creates horrendous things. Already g[[[],6,2],2] will far exceed the current golfscript answers.

Next, we have [[],2,k], which behaves approximately like k+1 nestings of [[],1,...], and in Knuth's up-arrow notation:

g[[[],2,k],n] > (2^n)↑↑(k+1)

And then we get things like

g[[[],2,[]],n] > g[[[],2,n],n] > (2^n)↑↑(n+1) > n↑↑n

And then

g[[[],2,[[],0,0]],n] > g[[[],2,[]],n*2] > (n*2)↑↑(n*2)

etc.

Some values of interest:

g[[[],3,k],n] ~ n↑↑...k arrows...↑↑n
g[[[],4,1],n] ~ Ack(n,n)
g[[[],3,[[],0,0]],20] ~ Toeofdoom's a_20(1)
g[[[],3,[[],0,0]],64] ~ Graham's number
g[[[],3,[[],1,1]],15] ~ eaglgenes101's number
g[[[],4,2],127] ~ col6y's number
g[[[[],4,3],2,[]],3] ~ my older/other number
g[[[],6,1],9] ~ r.e.s.'s number
g[[[[],6,1],2,[[[],0,0],4,1]],17] ~ Peter Taylor's number

In the fast growing hierarchy, g[[[],n,n],n] is approximately fφn(ω)(n). My number is g[[n,[],n],n], which is approximately fφω(ω)(n), where n = 65535.

Simply Beautiful Art

Posted 2014-01-08T23:13:21.950

Reputation: 2 140

5

C

(With apologies to Darren Stone)

long n,o,p,q,r;main(){while(--n){while(--o){while(--p){while(--q){while(--r){putchar('z'-'A');}}}}}}

n = 2^64 digit number (9...)

l = 100 chars of code

score ≈ 1e+2135987035920910082395021706169552114602704522356652769947041607822219725780640550022962086936570 ≈ 10↑↑3.2974890744

[ Score = n^5/l^3 = (10^(2^320)-1)/(100^3) = (10^2135987035920910082395021706169552114602704522356652769947041607822219725780640550022962086936576-1)/(10^6) ]

Note that I deserve to be flogged mercilessly for this answer, but couldn't resist. I don't recommend acting like me on stackexchange, for obvious reasons. :-P


EDIT: It would be even harder to resist the temptation to go with something like

long n;main(){putchar('z'-'A');putchar('e');putchar('+');while(--n){putchar('z'-'A');}

...but I suppose that an intended but unspecified rule was that the entire run of digits making up the number must be printed.

ecksemmess

Posted 2014-01-08T23:13:21.950

Reputation: 51

1#DEFINE C while(-- long n,o,p,q,r,s,t;main(){Cn){Co){Cp){Cq){Cr{Cs{Ct){putchar('z'-'A');}}}}}}}} – RobAu – 2014-01-09T12:36:08.130

@RobAu You're a genius! Make it an answer. I'm sure it'd be the winner. I think you forgot a couple ), but that's okay, because you're only at 96 characters right now. – Andrew Larsson – 2014-01-09T23:14:54.460

For everyone that didn't get the sarcasm: see http://codegolf.stackexchange.com/a/18060/7021 for an even better solution ;)

– RobAu – 2014-01-10T13:45:08.563

5

ECMAScript 6 - 10^3↑↑↑↑3 / 884736

(3↑↑↑↑3 is G(1) where G(64) is Graham's number)

u=-~[v=+[]+[]]+[];v+=e=v+v+v;D=x=>x.substr(u);K=(n,b)=>b[u]?n?K(D(n),K(n,D(b))):b+b+b:e;u+K(v,e)

Output: 10^3↑↑↑↑3

Hints:

G is the function where G(64) is Graham's number. Input is an integer. Output is a unary string written with 0. Removed for brevity.

K is the Knuth up-arrow function a ↑n b where a is implicitly 3. Input is n, a unary string, and b, a unary string. Output is a unary string.

u is "1".

v is "0000", or G(0)

e is "000".

Kendall Frey

Posted 2014-01-08T23:13:21.950

Reputation: 2 384

@Cruncher Things like this are only unbeatable for the uncreative ;) – Simply Beautiful Art – 2017-05-13T11:07:39.910

Maximum code length is 100 bytes; Otherwise this is near unbeatable – Cruncher – 2014-01-09T14:16:03.220

@Cruncher Aaah, I missed that – Kendall Frey – 2014-01-09T14:24:08.080

Ahh, I hate you now. Everytime I try to fathom the size of Graham's number my head hurts. – Cruncher – 2014-01-09T14:34:35.843

also, doesn't Graham's number count as a constant > 10? – serakfalcon – 2014-01-09T14:35:48.233

Can't you just like K(K(K(K(K(floor(pi)))))) – Cruncher – 2014-01-09T14:40:14.790

or like a = K(floor(pi)); loop from 0 to K(K(K(floor(pi)))): a = K(K(K(a))); – Cruncher – 2014-01-09T14:46:54.050

1Now to determine if mine beats Ilmari's. – Kendall Frey – 2014-01-09T15:00:51.607

5

R - 49 41 characters of code, 4.03624169270483442*10^5928 ≈ 10↑↑2.576681348

set.seed(T)
cat(abs(.Random.seed),sep="")

will print out [reproducing here just the start]:

403624169270483442010614603558397222347416148937479386587122217348........

lebatsnok

Posted 2014-01-08T23:13:21.950

Reputation: 383

2I don't think you need to include the number in the post. It takes up a lot of space on mobile as well. – totallyhuman – 2017-05-12T14:02:57.490

@totallyhuman I agree, maybe the first 100 digits, max – tuskiomi – 2017-05-12T15:07:36.453

@totallyhuman ok thanks done :) – lebatsnok – 2017-05-19T06:05:21.350

cat is a weird function in that the first argument is .... So everything before the first named argument goes to ... (and will be cat'ed), which is why sep must be named -- otherwise one could shorten it as cat(abs(.Random.seed),,"") – lebatsnok – 2018-05-17T07:48:09.037

4

Powershell (2.53e107976 / 72³ = 6.78e107970 ≈ 10↑↑1.701853371)

This takes far more than 5 seconds to run.

-join(-split(gci \ -r -EA:SilentlyContinue|select Length))-replace"[^\d]"

It retrieves and concatenates the byte length of every file on your current drive. Regex strips out any non-digit characters.

Hand-E-Food

Posted 2014-01-08T23:13:21.950

Reputation: 7 912

Rule 1 says no digits allowed, you have a 0 in there. – Kyle Kanos – 2014-01-09T03:05:12.833

Damn, I do too. There goes my character count. – Hand-E-Food – 2014-01-09T03:54:37.533

You can use -ea(+'') to reduce the size ('' converted to a number is 0, which the enum value of SilentlyContinue). You can use \D for the replacement regex which is the same as [^\d]. And you can just use %{$_.Length} instead of select Length which gets rid of the column headers. And then you can get rid of the -split and -replace as well, leaving you with -join(gci \ -ea(+'')-r|%{$_.Length}) which is 37 characters shorter (I also reordered the parameters because the parentheses are needed anyway because of +''). – Joey – 2014-01-11T12:01:37.043

4

JavaScript 98 chars

m=Math;a=k=(''+m.E).replace('.',"");j=m.PI%(a&-a);for(i=j;i<(m.E<<k<<k<<k<<m.E);i+=j)a+=k;alert(a)

generates 2.718e+239622337 ≈ 10↑↑2.9232195202

For score of just slightly more than 2.718e+239622331 ≈ 10↑↑2.9232195197

which is the largest I can make it without the browser crashing.

(console.log(a) will show you the full output)

Don't run these:

m=Math;a=k=(''+m.E).replace('.',"");j=m.PI%(a&-a);for(i=j;i<(k<<k<<k<<k<<k<<k<<k);i+=j)a+=k;alert(a)

would output 2.718+e121333054704 ≈ 10↑↑3.0189898069 (aka 2.718*10^(1.213*10^12) to compare to the longer answer:

more extreme version, if it didn't crash your browser: (80 char)

m=Math;a=k=(''+m.E).replace('.',"");j=m.PI%(a&-a);for(i=j;i<k;i+=j)a+=k;alert(a)

which would create a number around the same size as e * 10^(10^19) ≈ 10↑↑3.106786869689

Edit: updated code original solution only generated 2.718e+464

serakfalcon

Posted 2014-01-08T23:13:21.950

Reputation: 141

4

GNU Bash, 10^40964096² / 80^3 ≈ 10↑↑2.072820169

C=$(stat -c %s /) sh -c 'dd if=/dev/zero bs=$C$C count=$C$C|tr \\$((C-C)) $SHLVL'

C = 4096 on any reasonable system. SHLVL is a small positive integer (usually either 1 or 2 depending on whether /bin/sh is bash or not).

64 bit UNIX only:

Score: ~ 10^(40964096409640964096*40964096409640964096) / 88^3

C=$(stat -c %s /) sh -c 'dd if=/dev/zero bs=$C$C$C$C$C count=$C$C$C$C$C|tr \\$((C-C)) $SHLVL'

Joshua

Posted 2014-01-08T23:13:21.950

Reputation: 3 043

SHLVL is the level of bash as subbash: bash -c 'bash -c "echo \$SHLVL"' – F. Hauri – 2016-01-03T07:41:13.773

stat --printf don't work. Try stat -c %s – F. Hauri – 2016-01-03T07:41:54.537

@F.Hauri: --printf works for me but so does -c so that shaved a few bytes. Thanks. – Joshua – 2016-01-03T20:42:19.147

4

Haskell - Ackermann function applied to its result 20 times - 99 characters

This is the best haskell solution I can come up with based on the ackermann function - you may notice some similarities to n.m.'s solution, the i=round$log pi was inspired from there and the rest is coincidence :D

i=round$log pi
n?m|m<i=n+i|n<i=i?(m-i)|True=(n-i)?m?(m-i)
a n=n?n
b=a.a.a.a
main=print$b$b$b$b$b$i

It runs the ackermann function on itself 20 times, starting at one, the sequence being

  • 1,
  • 3,
  • 61,
  • a(61,61),
  • a(a(61,61),a(61,61)) --- we will call this a2(61), or a4(1) ---
  • a3(61)
  • ...
  • a18(61), or a20(1). I think this is approximately g18 (see below).

As for the estimation, wikipedia says:

a(m,n) = 2↑m-2(n+3) - 3

From this we can see a3(1) = a(61,61) = 2↑5964 + 3, which is clearly greater than g1 = 3↑43, unless the 3 at the start is far more important than I think. After that, each level does the following (discarding the insignificant constants in an):

  • gn = 3↑gn-13
  • an ~= 2↑an-1(an-1)

If these are approximately equivalent, then a20(1) ~= g18. The final term in an, (an-1) is far greater than 3, so it is potentially higher than g18. I'll see if I can figure out if that would boost it even a single iteration and report back.

Toeofdoom

Posted 2014-01-08T23:13:21.950

Reputation: 171

Your analysis is correct and g<sub>18</sub> is a good approximation. – Simply Beautiful Art – 2017-06-20T17:37:47.010

length"a" saves a couple bytes and allows you another .a – Khuldraeseth na'Barya – 2019-07-01T21:54:41.757

4

C, 10^10^2485766 ≈ 10↑↑3.805871804

unsigned a['~'<<'\v'],l='~'<<'\v',i,z;main(){while(*a<~z)for(i=l;printf("%u",~z),i--&&!++a[i];);}

We create an array of 258048 unsigned integers. It couldn't be unsigned longs because that made the program too long. They are unsigned because I don't want to use undefined behavior, this code is proper C (other than the lack of return from main()) and will compile and run on any normal machine, it will keep running for a long time though. This size is the biggest we can legally express without using non-ascii characters.

We loop through the array starting from the last element. We print the digits of 2^32-1, increment the element and drop the loop if the element hasn't wrapped to 0. This way we'll loop (2^32 - 1)^254048 = 2^8257536 times, printing 10 digits each time.

Here's example code that shows the principle in a more limited data range:

#include <stdio.h>
unsigned int a[3],l=3,i,f;

int
main(int argc, char *argc){
        while (*a<4) {
        for (i = l; i-- && (a[i] = (a[i] + 1) % 5) == 0;);
            for (f = 0; f < l; f++)
                printf("%lu ", a[f]);
            printf("\n");
        }
}

The result is roughly 10^10^2485766 divided by a million which is still roughly 10^10^2485766.

Art

Posted 2014-01-08T23:13:21.950

Reputation: 545

Best C implementation, by far. Why use 5 variables, when you can use an array of 258048? – primo – 2014-01-16T17:31:09.133

4

x86 machine code - 100 bytes (Assembled as MSDOS .com file)

Note: may bend the rules a little

This program will output 2(65536*8+32) nines which would put the score at (102524320-1) / 1000000

As a counter this program uses the entire stack (64kiB) plus two 16bit registers

Assembled code:

8A3E61018CD289166101892663018ED331E4BB3A01438A2627
018827A0300130E4FEC4FEC4FEC410E4FEC400E431C95139CC
75FB31D231C931DBCD3F4175F94275F45941750839D4740D59
4174F85131C939D475F9EBDD8B266301A161018ED0C3535858

Assembly:

ORG 0x100

SECTION .TEXT
            mov bh, [b_ss]
            mov dx, ss
            mov [b_ss], dx
            mov [b_sp], sp
            mov ss, bx
            xor sp, sp
            mov bx, inthackdst
            inc bx
            mov ah, [inthacksrc]
            mov [bx], ah
            mov al, [nine]
            xor ah, ah
            inc ah
            inc ah
            inc ah
inthacksrc: adc ah, ah
            inc ah
            add ah, ah
            xor cx, cx
fillstack:  push cx
nine:       cmp sp, cx
            jnz fillstack
regloop:    xor dx, dx
dxloop:     xor cx, cx
cxloop:     xor bx, bx
inthackdst: int '?'
            inc cx
            jnz cxloop
            inc dx
            jnz dxloop
            pop cx
            inc cx
            jnz restack
popmore:    cmp sp, dx
            jz end
            pop cx
            inc cx
            jz popmore
restack:    push cx
            xor cx, cx
            cmp sp, dx
            jnz restack
            jmp regloop
end:        mov sp, [b_sp]
            mov ax, [b_ss]
            mov ss, ax
            ret

b_ss:       dw 'SX'
b_sp:       db 'X'

Robert Sørlie

Posted 2014-01-08T23:13:21.950

Reputation: 1 036

You obviously never ran this. It overwrites its code and crashes. – Joshua – 2016-01-03T20:52:08.147

4

C

The file size is 45 bytes.

The program is:

main(){long d='~~~~~~~~';while(--d)printf("%ld",d);}

And the number produced is larger than 10^(10^(10^1.305451600608433)).

The file I redirected std out to is currently over 16 Gb, and still growing.

The program would terminate in a reasonable amount of time if I had a better computer.

My score is uncomputable with double precision floating point.

iWiggins

Posted 2014-01-08T23:13:21.950

Reputation: 141

4

Python 3, score = ack(126,126)/100^3

g=len('"');i=ord('~');f=lambda m,n:(f(m-g,f(m,n-g))if n else f(m-g,g))if m else n+g
print(f(i,i))

The f function is the ackermann function, which i have just enough space to invoke.

Edit: previously "else n+1", which was in violation of challenge rules- kudos to Simply Beautiful Art.

Magenta

Posted 2014-01-08T23:13:21.950

Reputation: 1 322

You can increase your number by changing f(m-g,g) to f(m-g,m). – Simply Beautiful Art – 2017-05-13T22:36:51.097

or f(m-g,i). Also, at the end of the first line, you use a number. I believe you meant to use n+g, whereupon I will point out n+n will be larger. – Simply Beautiful Art – 2017-05-13T22:56:03.133

You can save a few bytes by changing len('"') for True – Brian Minton – 2017-05-18T20:16:44.267

And use ord('^?') (where ^? is the DEL character, ASCII 127) for a bigger number. EDIT never mind, that's not "Printable". – Brian Minton – 2017-05-18T20:29:08.610

@BrianMinton Who says it has to be printable? – Simply Beautiful Art – 2017-05-18T23:51:02.830

You're right of course, only the output needs to be printable. – Brian Minton – 2017-05-19T00:03:00.303

:-) hopefully with the violation removed, my adding you to the leaderboard should be fine. – Simply Beautiful Art – 2017-06-20T17:51:35.773

3

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.

Steven H.

Posted 2014-01-08T23:13:21.950

Reputation: 2 841

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 – 2017-12-03T18:29:06.117

I didn't even realize that you didn't allow for [[],[],n] in your program. – Steven H. – 2017-12-03T21:22:26.993

Doing so would cost me 1 more byte. – Simply Beautiful Art – 2017-12-03T21:33:13.210

Woo... I finally managed to do f[[n,[],n],n]! x'D – Simply Beautiful Art – 2019-05-18T19:55:07.643

3

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.

Jo King

Posted 2014-01-08T23:13:21.950

Reputation: 38 234

3

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.

ybeltukov

Posted 2014-01-08T23:13:21.950

Reputation: 1 841

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 – 2014-01-09T11:24:23.243

Ok i take the non deterministic back, because there is no seed like you wrote. – klingt.net – 2014-01-09T11:35:42.457

1How about ~' ' instead of rand(), printed with %u ? Two bytes less source, and a higher value. – MSalters – 2014-01-10T09:30:49.523

3

Python 3: 98 chars, ≈ 10 ↑↑ 256

Using a variable-argument function:

E=lambda n,*C:E(*([~-n][:n]+[int("%d%d"%(k,k))for k in C]))if C else n;print(E(*range(ord('~'))))

Effectively, E decrements the first argument while increasing the rest of the arguments, except that instead of putting -1 in the arguments it drops the argument. Since every cycle either decrements the first argument or decreases the number of arguments, this is guaranteed to terminate. The increasing function used is int("%d%d"%(k,k)), which gives a result between k**2 + 2*k and 10*k**2 + k. My code does use the * symbol - but not as multiplication. It's used to work with variable numbers of arguments, which I think should follow the rules since the clear point of the rules was to restrict specific operations, not the symbols themselves.

Some examples of how large E gets quickly:

E(1,1) = 1111
E(0,1,1) = E(11,11) = (approx) 10^8191
E(1,1,1) = E(1111,1111) = (approx) 10^(10^335)
E(2,1,1) = E(11111111,11111111) = (approx) 10^(10^3344779)

Only the first two of those are runnable on my computer in a reasonable amount of time.

Then, E is invoked by E(*range(ord('~'))) - which means:

E(0,1,2,3,4,5, ... ,121,122,123,124,125)

I'm not entirely sure how large this is (I've been trying to approximate it to no avail) - but it's obvious that it's ~really~ big.

As an example, about twelve cycles in, the result is around: (technically a bit more than)

E(2**27211,2**27211,2**27212,2**27212,2**27212,2**27212,2**27213,2**27213,2**54423,2**54423,2**54423,2**54423,2**54423,2**54423,2**54423,2**54423,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54424,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54425,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**54426,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636,2**81636)

Result estimation:

If we approximate the increasing step by lambda k: 10 * k**2, the function can be described as

E(n, C₁, C₂, ... Cᵥ) ≈ E(10^(n²/2) ⋅ C₁²ⁿ, 10^(n²/2) ⋅ C₂²ⁿ, ... 10^(n²/2) ⋅ Cᵥ²ⁿ)
                     ≈ E(10^((10^(n²/2) ⋅ C₁²ⁿ)²/2) ⋅ C₂^(2n  ⋅ 10^(n²/2) ⋅ C₁²ⁿ), ... )
                     ≈ E(10^((10^n² ⋅ C₁⁴ⁿ)/2) ⋅ C₂^(2n  ⋅ 10^(n²/2) ⋅ C₁²ⁿ), ... )

The relevant thing we're doing here is build up a tower of powers of ten, so the eventual score can be approximated as 10 ↑↑ 256.

Better (although partial) result estimation:

This uses the same 10 * k**2 as the other estimation.

E(0, b) = 10 * b**2
E(1, b) = 10 * (10 * b**2)**2 = 10 * 100 * b**4 = 10**3 * b**4
E(2, b) = 10 * (10**3 * b**4)**2 = 10 * (10**6 * b**8) = 10**7 * b**8
E(a, b) = 10**(2**(a+1)-1) * b**(2**(a+1))

Under the previous estimation, it would be:

E(a, b) = 10**(a**2/a) * b**(2*a)

Which is significantly smaller than the actual value since it uses a**2 instead of 2**a for the 10 and uses a*2 instead of 2**a for the b.

Cel Skeggs

Posted 2014-01-08T23:13:21.950

Reputation: 901

I estimated your result, feel free to disagree. – ceased to turn counterclockwis – 2014-01-12T14:26:01.037

I have to disagree with that result. One moment while I type out my reasoning. – Cel Skeggs – 2014-01-12T20:18:34.747

There we go. As I said in the update, your estimation appears to be significantly smaller than the actual value. – Cel Skeggs – 2014-01-12T20:25:17.700

Fair enough, but at any rate we need a recursive-inductive / at-once estimation, not just a single step, to include this answer in the scoring list. I'm certain your score is better than recursive's, but also pretty sure not better than Ilmari Karonen's (which is very extendable anyway, using only 18 characters at the moment), so I think my estimation is good enough for the scoring purpose. – ceased to turn counterclockwis – 2014-01-12T20:27:37.833

I agree. I'll see if I can work more at it and at least come up with a more accurate lower bound for the result. – Cel Skeggs – 2014-01-12T20:29:18.047

I got here: E(kn, ..., k2, k1, k0, j) = (10*j)^(2^(n-1+E(kn)+...+E(kn,...,k2)+E(kn,...,k2,k1)+E(kn,...,k2,k1,k0)))/10 but I can't get it down to a single result without cutting out even more. If anyone can think of any way to simplify a^(2^b), that'd be helpful. – Cel Skeggs – 2014-01-13T01:56:01.157

I went and made a new submission that can be analyzed more easily. So I'm not going to finish the analysis of this one. – Cel Skeggs – 2014-01-13T06:48:10.950

2

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

BlackCap

Posted 2014-01-08T23:13:21.950

Reputation: 3 576

Can you explain your number in non-code form? If so, I can probably analyze and provide a score for you. – Simply Beautiful Art – 2017-05-19T20:06:57.513

@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 – 2017-05-19T21:06:31.463

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 – 2017-05-19T21:09:57.513

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 – 2017-05-19T21:32:59.357

@SimplyBeautifulArt I pass in a function that concatenates a string with itself. Ruby translation: https://pastebin.com/xUhiBTp6 (hopefully I got that right)

– BlackCap – 2017-05-19T21:46:46.960

You sure it terminates rather than goes on an infinite loop between fa and q? – Simply Beautiful Art – 2017-05-19T22:12:42.380

yes, the q fa chain produces a function that takes a function and repeats it over its input some number of times. It is passed f after the loop, which is going to be the concatenation function at the top most level. – BlackCap – 2017-05-19T22:23:29.483

Let us continue this discussion in chat.

– Simply Beautiful Art – 2017-05-19T22:36:26.487

The special character is actually 3 bytes, but your code is still 100 bytes. – Simply Beautiful Art – 2017-05-20T15:09:10.880

Interestingly, the last character on this site is one byte less than but has larger ascii value.

– Simply Beautiful Art – 2017-10-27T21:24:01.413

Er no. It doesn't save one byte it seems. :P – Simply Beautiful Art – 2017-10-27T21:39:38.420

2

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!

Govind Parmar

Posted 2014-01-08T23:13:21.950

Reputation: 828

If it works as you claim, then that would be approximately 10^10^10^10^0.0114 ≈ 10↑↑3.0114 – Simply Beautiful Art – 2017-06-21T14:02:42.833

@SimplyBeautifulArt thank you! – Govind Parmar – 2017-06-21T14:13:00.930

No problem. It's what I'm here for. – Simply Beautiful Art – 2017-06-21T14:16:36.527

@SimplyBeautifulArt Did you include dividing by the size of the code cubed in your answer? Thanks! – Govind Parmar – 2017-06-21T17:09:29.550

1Yes 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 – 2017-06-21T19:49:34.067

2

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)

EricShermanCS

Posted 2014-01-08T23:13:21.950

Reputation: 121

1Since your last one was disqualified, mind deleting it? Thanks. But +1 to this one :) – HyperNeutrino – 2017-10-24T20:23:19.253

2

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('~'))

eaglgenes101

Posted 2014-01-08T23:13:21.950

Reputation: 577

Could you ungolf it? Can't help you approximate your number if I can't understand it. – Simply Beautiful Art – 2017-11-01T11:41:04.553

Alright, presented an ungolfed explanation for estimation purposes. – eaglgenes101 – 2017-11-01T12:51:07.707

1As 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 – 2017-11-01T13:02:51.993

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 – 2017-11-01T13:05:24.140

Rather than calling ~ 15 times, you cannot do some sort of loop or something? – Simply Beautiful Art – 2017-11-01T13:11:20.487

I meant to say TIO link in my comment above. – Simply Beautiful Art – 2017-11-01T14:16:56.717

Can't you compress the $ calls as something like c(x)=x|>x$y$z->z+1;? – Simply Beautiful Art – 2018-07-04T16:02:29.833

Yeah, good point. I'm putting together a new solution that, if all goes well, will be able to make it to the feferman schutte ordinal. (Metadiagonalzation is one hell of a mind-bender!) – eaglgenes101 – 2018-07-04T18:53:22.920

Actually, taking a second look, it's closer to the ωth veblen function ordinal. Still more than many of the sumbissions here. – eaglgenes101 – 2018-07-04T19:24:37.807

1Good luck then! – Simply Beautiful Art – 2018-07-04T21:39:10.837

Well, I tried, and I failed. I tried to fit in diagonalization over the diagonalization, but it didn't fit, and I had to settle for applying the diagonalization three times. Also, the score needs double checking, since I'm not completely clear about the fast-growing hierarchy at this point. – eaglgenes101 – 2018-07-04T22:55:13.337

2

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

Kyle Kanos

Posted 2014-01-08T23:13:21.950

Reputation: 4 270

2

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

Cezar Moise

Posted 2014-01-08T23:13:21.950

Reputation: 31

1This isn't a full program, just a REPL script. – LegionMammal978 – 2016-03-26T20:36:30.553

1Last time I checked 9999999... was a number :P – Vereos – 2014-01-13T12:37:45.810

2

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.

natman3400

Posted 2014-01-08T23:13:21.950

Reputation: 21

I guess 2 and 1 are digits, though :P – Vereos – 2014-01-14T22:56:23.240

1You 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 – 2014-01-14T23:00:08.313

2

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

histocrat

Posted 2014-01-08T23:13:21.950

Reputation: 20 600

"... 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. – 2014-01-19T19:47:17.950

You're right, I'd misread. No proof that this actually terminates, then. – histocrat – 2014-01-19T20:46:13.757

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. – 2014-01-19T20:52:53.907

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 – 2014-01-19T21:31:03.023

2

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.

Theoxarhs2099

Posted 2014-01-08T23:13:21.950

Reputation: 89

No, don't mod 10 it. It's not a constant, plus it uses digits, which is not allowed. – Brian Minton – 2017-05-19T14:04:20.870

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 – 2014-04-07T11:11:17.063

2

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.

Robert Benson

Posted 2014-01-08T23:13:21.950

Reputation: 1 339

1

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.

Post Rock Garf Hunter

Posted 2014-01-08T23:13:21.950

Reputation: 55 382

1

Braingolf, 10 bytes, final score: ≈ 10131 ≈ 10↑↑2.3257765097

#[l!_]

Note that is a 4 byte ASCII character with the value 1114111

Outputs every number from 2 to 1114111 with no spaces or other separators. Somewhere around 6.7m digits, but can we make it bigger...

Braingolf, 100 bytes

#...............[l!_][l!_][l!_][l!_][l!_][l!_][l!_][l!_][l!_][l!_][l!_][l!_][l!_][l!_][l!_][l!_]

This does the same as above, but 16 times over. Meaning the final number is every number from 1 to 17825792 appended. 131m digits.

Not the largest or the winner by any stretch, but still pretty good, and probably as good as one can do in Braingolf given the banning of operators

Skidsdev

Posted 2014-01-08T23:13:21.950

Reputation: 9 656

1

J, fω(256) / 50653

(<:@[$:~^:]])`(>:@])@.(=(#>a.)"_)~#a.

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:

f =: dyad define
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

Bolce Bussiere

Posted 2014-01-08T23:13:21.950

Reputation: 970

1

GTB

Don't run this on your calculator (it leaks memory)

[%X:"]

Code length = 6 bytes (63=216)

Score = 13,256,072 (2,863,311,531/216)

**Assumes 16 GB free memory on an emulator for Windows*

Timtech

Posted 2014-01-08T23:13:21.950

Reputation: 12 038

6one of the rules stated:

You cannot use digits in your code (0123456789)

I don't know if this counts, dude..? – WallyWest – 2014-01-09T01:55:41.757

1@Eliseod'Annunzio Fixed. – Timtech – 2014-01-09T16:42:42.153

1

JavaScript - 84 Characters - Final Score: 2.082941723E+2886 ≈ 10↑↑2.390912646

Code:

(function n(a){b=a.length+'';a.push(b);b.length<Math.PI?n(a):alert(a.join(''))})([])

Output:

01234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000

(2893 digits)

Score:

(Calculated using http://keisan.casio.com/calculator)

Output / 84^3 = 2.082941723E+2886

user1886419

Posted 2014-01-08T23:13:21.950

Reputation: 1 015

1

C - 92 bytes (score 1.2842113915e4373822 ≈ 10↑↑2.822224398)

main(){char c='~',n='z'-'A',f=c,g=c;while(--c!=n)while(--f!=n)while(--g!=n)printf("%c",n);}

Wrote this before I found someone already posted a C solution. Oh, well.

This program generates the digit '9' by subtracting the ascii value 'A' from 'z', then repeatedly prints it.

Since the characters wrap around the container values, it actually repeats more than just the simple (126-57)^3 from the character values, it instead wraps around the character cells after subtraction, resulting in repeating the digit '9' 4373828 times. (I'm too tired right now to figure out why that particular number, but I'll edit later)

Tyzoid

Posted 2014-01-08T23:13:21.950

Reputation: 692

1

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)

Kevin Fegan

Posted 2014-01-08T23:13:21.950

Reputation: 121

You are missing a -e in your call to sed – Bary12 – 2018-07-05T08:44:57.503

@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 – 2018-07-07T21:54:40.677

@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 – 2018-07-07T22:05:11.897

Oh, my bad, I was using Zsh, that actually had problems with the pattern not being inside a string. – Bary12 – 2018-07-08T08:57:02.420

1

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))

Additional

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

Adam Speight

Posted 2014-01-08T23:13:21.950

Reputation: 1 234

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 – 2014-01-10T15:07:25.370

@Vereos BLEEP! Now I have find a way to subtract one, without using one. – Adam Speight – 2014-01-10T15:13:51.100

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 – 2014-01-15T16:26:24.400

@primo the score I'm is the Version 3 one. – Adam Speight – 2014-01-16T19:52:28.403

1

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

Nate Eldredge

Posted 2014-01-08T23:13:21.950

Reputation: 2 544

1

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

Reut Sharabani

Posted 2014-01-08T23:13:21.950

Reputation: 208

I do not enjoy numbers that depend on luck. – Simply Beautiful Art – 2017-05-13T15:13:30.107

1

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.

Pouya

Posted 2014-01-08T23:13:21.950

Reputation: 11

1

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.

S.S. Anne

Posted 2014-01-08T23:13:21.950

Reputation: 1 161

1

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.

Random Guy

Posted 2014-01-08T23:13:21.950

Reputation: 375

3

I suppose by x!!!! you actually mean (((x!)!)!)!? (there's an important difference)

– Martin Ender – 2015-03-18T03:18:45.403

1

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
   $a+=hexdec($b.$b)//add 4294967295?
)
echo$a //output $a once per loop
?>

9999years

Posted 2014-01-08T23:13:21.950

Reputation: 166

No need to include the PHP tags (<? and ?>). – usandfriends – 2016-01-02T20:32:10.697

@usandfriends: PHP doesn't parse it as code without them (see here).

– 9999years – 2016-01-02T20:55:19.177

I meant for calculating byte count. See the other PHP answers, they don't include the tags. – usandfriends – 2016-01-02T21:19:41.893

tags must be counted, so make it 62 bytes ... these 51 will do the same: for(;$i++<hexdec($b=FFFF);$a+=hexdec($b.$b))echo$a; – Titus – 2017-05-12T13:48:38.700

@9999years (That´s with the -r flag, wich comes free.)

– Titus – 2017-05-12T18:48:13.670

1

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

SuperJedi224

Posted 2014-01-08T23:13:21.950

Reputation: 11 342

1Note: the exact value of this number is 1111111111111111111111111111111111111111111/107811, or 10306101521283645556678920621375472921+25180/107811. – LegionMammal978 – 2016-03-26T11:29:49.240

1Also, note that due to padding, this outputs a trailing NUL byte. – LegionMammal978 – 2016-03-26T11:34:20.137

1

Javascript, more than 10^(16*2^2718281828459046) / 54^3 ≈ 10↑↑3.069506124

for(a=b=(Math.E+'').replace(".","");a--;b+=b);alert(b)

Description:

  • (Math.E+'') is "2.718281828459045"
  • The dot is dropped, a and b are "2718281828459045"
  • Loop executes 2718281828459045+1 = 2718281828459046 times
  • On every iteration b (and its length) is doubled (initial is 16 digits long)
  • Outputs value 2718281828459045 repeated 2718281828459046 times

Qwertiy

Posted 2014-01-08T23:13:21.950

Reputation: 2 697

You're score would be 2718281828459045*2718281828459046, no? – tuskiomi – 2017-05-18T18:49:39.687

@tuskiomi, in b+=b i'm concatenating string from b with itself, so its length doubles. – Qwertiy – 2017-05-18T19:07:15.327

So the above number times 2. – tuskiomi – 2017-05-18T19:10:13.553

@tuskiomi, nope, the output is concatenated string, not its length. And that's not addition, that's concatenation. Try following program for(a=4,b=(Math.E+'').replace(".","");a--;b+=b)console.log(b);console.log(b) - it makes only 4 steps instead of 2718281828459045 and outputs b to the console on each step and the last value that is alerted in original code. – Qwertiy – 2017-05-18T19:35:04.823

@tuskiomi, only with 4 iterations value becomes 2718281828459045271828182845904527182818284590452718281828459045271828182845904527182818284590452718281828459045271828182845904527182818284590452718281828459045271828182845904527182818284590452718281828459045271828182845904527182818284590452718281828459045 that is definitely larger than 2718281828459045*2718281828459046 = 7389056098930651665961070771070 :) – Qwertiy – 2017-05-18T19:38:08.290

so it's 16*(1+2+3+4 ... 2718281828459046). – tuskiomi – 2017-05-18T19:38:21.447

Let us continue this discussion in chat.

– Qwertiy – 2017-05-18T19:38:31.210

0

Mathematica, 1.08544407066*10^23496 ≈ 10↑↑2.640580269

N[Cosh[Cosh[Cosh[Pi]]]]

It applies the hyperbolic cosine function to pi 3 times. If I had applied it 4 times, it would've caused an overflow error.

Horváth Dávid

Posted 2014-01-08T23:13:21.950

Reputation: 679

Overflow error should not be a problem here. – Simply Beautiful Art – 2017-05-12T11:53:53.737

N[Cosh[Cosh[Cosh[Cosh[Cosh[Cosh[Cosh[Cosh[Cosh[Cosh[Pi]]]]]]]]]]]. – user75200 – 2017-12-28T15:15:13.923

0

Python2

o=oct(ord('~'))
for a in range(int(o)):
    o+=o*int(o)
    for b in range(int(o)):
        o+=o*int(o)
o*int(o)

This is exactly 100 characters if the indentations are tabs.

In order for the program to output, it needs to be run in a python console rather than in a file.

Score is unknown at this point because the inner for loop will run 10e707 times in the first iteration of the outer loop. and in total, there will be 176 iterations of the outer loop. Also, this output is too big for me to even comprehend how to mark the notation for it.

bentallea

Posted 2014-01-08T23:13:21.950

Reputation: 1

1

Unnecessary spacing removed, there may be integer multiplication involved, there is nothing printed unless that's what the last line does, and the value of o*int(o) at the end should be approximately 10↑↑↑↑176.

– Simply Beautiful Art – 2019-05-18T19:30:52.977

For a small optimization, the third line should be moved up so that the outer loop runs more times. – Simply Beautiful Art – 2019-05-18T19:37:15.660

0

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:

Image of code.

user10766

Posted 2014-01-08T23:13:21.950

Reputation:

If you can explain how your number works for those who don't use C++, I might be able to analyze the result. – Simply Beautiful Art – 2017-05-19T15:09:24.970

Also, can we get this below 100 bytes? – Simply Beautiful Art – 2017-06-20T18:03:58.843

Rule 5 says that you can't use ^ or the equivalent library calls. – Kyle Kanos – 2014-01-09T02:54:42.060

Oh dear, guess I'd better re-work it. – None – 2014-01-09T03:17:56.327

@KyleKanos Fixed, is this better? – None – 2014-01-09T03:43:42.817

Nope, it has several digits in the code. – Hand-E-Food – 2014-01-09T03:56:11.210

@KyleKanos This better now? – None – 2014-01-09T04:06:04.247

@Hand-E-Food Is this fixed? – None – 2014-01-09T04:21:37.997

Looks better to me :) – Kyle Kanos – 2014-01-09T13:24:50.610

I don't know C++... can you combine the #include statements like: "#include<iostream> <ctime>" or "#include<iostream>,<ctime>" ??? – Kevin Fegan – 2014-01-10T02:20:48.433

@KevinFegan Not that I have ever heard of. – None – 2014-01-10T02:37:39.987

I count 99 characters including 2-newlines. Calculate score: (N)=output number. log10(N)=16585000. (99^3)=970299. log10(970299)=5.98690558. Score=10^(16585000-5.98690558)=10^(16584994.01309442). This will be a close approximation. Better: (H)=first (high) digit of (N). (Z)=actual captured-filesize (# of digits). If (H) is less than 5, use (Z-1). Substitute (Z) [or Z-1] for 16585000 above. Better yet: From (Z), subtract 1. Then add log10(H). Substitute (Z-1+log10(H)) for 16585000 above. Still approximate but quite close. – Kevin Fegan – 2014-01-10T15:39:22.687

Replace time(NULL) with time(0) to save six characters. Since you include the header file, the compiler sees the prototype and knows that time takes a pointer. In pointer contexts, 0 will be treated as the null pointer. – David Conrad – 2014-01-11T23:30:58.470

@DavidConrad I can't. The rules specify no digits in the code. – None – 2014-01-12T01:22:12.107

Whoops, I forgot. I guess I didn't think of the 0 as a number when it was representing a NULL pointer, but obviously, the rules disallow it. – David Conrad – 2014-01-12T04:22:03.487

@SimplyBeautifulArt It prints the POSIX timestamp at the moment the program is run, repeatedly, in a tight loop, for 5 seconds. – NieDzejkob – 2017-11-11T12:02:49.160

Uh, then does the output change depending on when you run the program? – Simply Beautiful Art – 2017-11-11T12:06:58.630

If I understand it correctly, your score would be something along the lines of 1.5e9 * number_of_loops. Suppose there are about 1000 loops in 5 seconds, then your score would be 1.5e12. – Simply Beautiful Art – 2017-11-11T12:10:18.147

0

C, ??? (91 characters)

main(int d,char**v){long c='\t'-'\b';for(;c;c++)for(d-=d;(*v)[d];d++)printf("%llu",(*v)[d]);}

If I could use ^, I'd write d^=d, but alas.

Run through argv[0] and print its contents as an unsigned long long.Repeat 2long-1 times.

Since argv[0] is the program's path, I'd assume the smallest possible value printed by this program (on Windows) would be A:\ .com with a 32 bit long. I'm not so sure on that though, smaller paths are probably possible.

Oberon

Posted 2014-01-08T23:13:21.950

Reputation: 2 881

You can as ^ is xor operator, not exponentiation. – user75200 – 2017-12-28T15:11:18.050

0

This is madness, to print the number it must be in the memory somehow, otherwise it would be considered as printing many separate numbers. I've written a JavaScript code and I've launched it in FireBug console. The largest result I've get with following code, on the quite strong workstation (8Core, 8GB RAM, haven't noted more details):

The code:

var e=Math.E,s=(e+'').replace('.',''),b=parseInt(s)
try{for(var i=e;i<b;i+=i)s+=s}catch(e){}
s

Code length: 94 characters (counted newlines as 1, you can replace them with semicolons and then it will be undoubtly 1). 94^3=830584. Test generated: '2718281828459045' repeated so many times, that the length of s was 1073741824 (over 1GB allocated). So the number is 2,7182*10^1073741824, and the points are:

3,27*10^1073741817

You can try to do that, but Firefox on my home laptop has crashed, so you need a really strong machine.

But many people has written the snipplets, noone has reported to be able to run! So let's remove that try.. catch and analyse what theoretically could happen:

The code:

var e=Math.E,s=(e+'').replace('.',''),b=parseInt(s);for(var i=e;i<b;i+=i)s+=s;s

Code length: 79 characters, 79^3=493039 The code will make 50 iterations generating the string of the length of 18014398509481984. Please verify if it would be able to store on 64 bit machine, but because the string is duplicated, there could be a theoretical machine able to compress such items in memory. However, I have no idea if there is enough energy in solar system to display the whole number on any console...

Anyway, we have number 2,7182*10^18014398509481984 divided by 79^3, so the poins are:

5,5*10^18014398509481977

Fill free to correct any mathematical errors, I've became a typical coding machine :D

Danubian Sailor

Posted 2014-01-08T23:13:21.950

Reputation: 101

In answer to your first statement: You can concatenate strings: this means that any sequence of adjacent digits will be considered as a single number; – Vereos – 2014-01-10T18:03:40.570

0

TURKEY BOMB

PUDDING

Score - Infinitely large number (as large as your system will store) / 73


Similarly, this one will limit the size to the size of your computer, up to infinity and into unknowable values:

HYBRID OBTAINED BY COMBINING PUDDING & NOMENCLATURE [WITH GUSTO]

Timtech

Posted 2014-01-08T23:13:21.950

Reputation: 12 038

1PUDDING is >10 – osvein – 2014-01-16T01:48:07.733

PUDDING is infinitely large. – Timtech – 2014-01-16T11:46:45.217

1WTF did I just read? – George Reith – 2014-01-20T00:47:20.973

@GeorgeReith "an almanac of black magic of some sort, with the cryptic title "Communications of the ACM,"" – Timtech – 2014-01-20T00:51:46.313

This language is unimplemented and therefore not a valid answer per current site rules. – lirtosiast – 2018-12-01T01:59:37.177

0

MATLAB ???/53^3

In matlab the maximum character size is defined and therefore this program will terminate eventually.

Basically it starts like this:

9
(9)!
((9)!)!
(((9)!)!)!    
...

I have no clue how big the number is but this will be allowed to grow to a string with approximately 2^41-1 elements (on windows 64 bit). Some help in estimating the resulting number size would be appreciated.

s=char('z'-'A')
while true
   s=['(' s ')!']
   vpa(s)
end

Dennis Jaheruddin

Posted 2014-01-08T23:13:21.950

Reputation: 1 848

11 is a digit, so is 2! – Vereos – 2014-01-15T10:02:44.717

@Vereos Edit: Thanks I did not even notice, have found a way around them! – Dennis Jaheruddin – 2014-01-15T10:12:20.927

This doesn't mean that those solutions are valid indeed. If you look at the leaderboard, you'll see that no solution in there has digits in it. EDIT: Alright :) – Vereos – 2014-01-15T10:12:36.400

The code at the bottom is an invalid program (non-terminating) and 9 is a digit. – Simply Beautiful Art – 2017-11-12T19:17:21.963

0

PHP (a lot)/83^3

Script should run for 99 seconds and produce as much 9's concatenated as it can.

$n=strlen("alphabeta");ini_set('max_execution_time',intval($n.$n));while($n)echo$n;

nl-x

Posted 2014-01-08T23:13:21.950

Reputation: 306

0

Squeak Smalltalk cheat: > 2^^(2^30) / 71^3 chars

^((Float pi at:Float e)to:(Float e at:Float e))reduceRight:[:x :y|x<<y]

Little explanation:

  • Internal bit representation of a Float can be accessed as a pair of 32 bit BigEndian words (a cheat)
  • #at: is tolerant and retries its parameter #asInteger (oh, not nice!)
  • << is left shift (a perfect cheat)
  • evaluate this expression via 'print it' menu, and the resulted number is printed in base 10

With characters left, I could also use significandAsInteger, but these are big enough yet. How big?

  • (Float pi at:Float e) -> 1413754136 > 2^31
  • (Float e at:Float e) -> 2333366121 > 2^31
  • ((Float pi at:Float e)to:(Float e at:Float e)) size -> 919611986>2^30

The first iteration is greater than 2^31*2^(2^31) > 2^^5
The second iteration is greater than 2^31*2^(2^^5) > 2^^6
...
The 2^30th iteration is greater than 2^^(2^30)

I let readers do the conversion to base 10, That kind of number gives me some vertigos...

Since this number is represented in memory, then converted to decimal by way of multiplications and divisions, let's say it's highly hypothetical...
Anyway, the technique consisting in storing the number in memory (base 2) then print, especially in Squeak is completely disqualified...
Creating a very small number is fast:
[1<<15000000] timeToRun -> 4 (milliseconds)
But LargeInteger package is not based on gmp and rapidly inefficient for base 10 conversion (naive * and /)
Even if I install a karatsuba multiplication, it takes quite long to print on my mac mini:
[1<<15000000 printOn: NullStream new] bench -> '2,700 seconds.'

A more reasonable loop in 32-bit memory:

What I can really execute is the first loop (let's omit the -1 on first term):

[((Float e at:Float e)<<(Float e at:Float e))] timeToRun -> 8732 (milliseconds)

As said above, I can 'do it' but I can't 'print it' in reasonable time with Squeak, though I can manipulate it, like having a guess of number of decimal digits:

((((Float e at:Float e)<<(Float e at:Float e)) highBit - 1) * 1233 >> 12) + 1-> 702402458, or log: 10 -> 10^(10^8.8)

aka.nice

Posted 2014-01-08T23:13:21.950

Reputation: 411

0

C, undetermined (infinite?) output length / 62^3 67^3

l(){printf("%o",rand())-!!l&&l();}main(){srand(time(!l));l();}

l(){for(;printf("%o",rand())-!!l;l());}main(){srand(time(!l));l();}

I'd written this a few days prior, but was having a hard time figuring out the expected average length of the output. The program (given enough stack and time) eventually will terminate.

Was going to post when I figured the output length, but since Nate Eldridge's is similar, posting it now.

Originally had !'!' instead of !l; borrowed that part from Nate's answer.

I also had a similar version without srand, at 42 48 characters:

main(){printf("%o",rand())-!!'!'&&main();}

main(){for(;printf("%o",rand())-!!'!';main());}

Mine terminate (on average) earlier, compared to Nate's (10/RAND_MAX chance of popping up the stack instead of 1/RAND_MAX), but output more digits per iteration (~10.43 vs 1).

Edit: original actually terminated after RAND_MAX/20 iterations on average. Golfed too far.

Edit2: not enough rep to comment. Golfed Nate's entries below mine (64 and 44):

w(){for(printf("%o",w);rand();w());}main(){srand(time(!w));w();}

main(){for(printf("%o",'I');rand();main());}

AlliedEnvy

Posted 2014-01-08T23:13:21.950

Reputation: 1 384

0

Idris, score >>> g64

h:Nat->Nat
h Z=S(S Z)
h(S y)=let n=h y in hyper n n n
let x=iterate h Z in index((index$S$S$S$Z)x)x

Last line is the expression resulting in an extremely high number. I did never use exponentiation directly, since I never even called the hyper operator on level 3. The fifth element of x already results in

hyper(hyper(hyper(hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2))),hyper(hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2))),hyper(hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)))),hyper(hyper(hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2))),hyper(hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2))),hyper(hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)))),hyper(hyper(hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2))),hyper(hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2))),hyper(hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)),hyper(hyper(2,2,2),hyper(2,2,2),hyper(2,2,2)))))

because the code builds up trinary trees of hyper operators. However, the now given value will be used to index an infinite stream, such that the n-th element of that stream equals h applied n times on zero. This results in a value much larger than Graham's number.

Mega Man

Posted 2014-01-08T23:13:21.950

Reputation: 1 379

hyper is a builtin? – Simply Beautiful Art – 2019-12-13T15:14:12.447

well, not builtin, but imported per default, as it's in prelude – Mega Man – 2019-12-15T14:21:09.740

0

Javascript, > 10316469 ≈ 10↑↑2.740388839

(Run from the browser console to get output)

for(a="",b="■".charCodeAt``;b--;)a+=(''+b).repeat("■".charCodeAt``);a

SuperJedi224

Posted 2014-01-08T23:13:21.950

Reputation: 11 342

0

R, 63 characters of code, 4.036242e+3699695 ≈ 10↑↑2.81744412

set.seed(T)
paste(rep(RS<-abs(.Random.seed),RS[exp(T)]),collapse="")
# the result will be 3699696 digits long
# 624 repetitions of 4036241692704834420106146035583972223....

... or you can have it printing for as long as you have time:

set.seed(T)
repeat{cat(abs(.Random.seed),sep="")}

lebatsnok

Posted 2014-01-08T23:13:21.950

Reputation: 383

0

Lua, Unknown/99^3 ≈ 10↑↑2.945956159

With infinite runtime:

m=math;p=m.pi;t=m.floor(p)s=tostring;h=t+s(p):sub(t)j=h;while(j>t)do io.write(s(h):rep(h))j=j-t;end

< 5 seconds:

m=math;p=m.pi;t=m.ceil(p)s=tostring;h=t+s(p):sub(-t)j=h;while(j>t)do io.write(s(h):rep(h))j=j-t;end

Ungolfed:

t=math.ceil(math.pi)                -- Acquire the number 4
h=t+tostring(math.pi):sub(-t)       -- Get the last t(4) digits of pi(5898) as a string.
                                    -- Adding t auto converts it to a number and increases our number
j=h;                                -- Set j as a counter to loop
while(j>t)do
    io.write(tostring(h):rep(h))    -- Add h(5902) repitions of h as a string to the output
    j=j-t;                          -- Decrement j by t(4), my only number available
end

Extra

Lua's lack of mathematical constants (other than pi) and ++ or -- operators made it tricky to manipulate numbers, but I thought I made good work with what I have. string.rep is the real hero.

If there's a notation that exists to write my score, I'll include it, but I don't know of one. If I was thinking correctly, the < 5 code's number should be (5902 repeated 5902 times) repeated ~5902/4 times.

Blab

Posted 2014-01-08T23:13:21.950

Reputation: 451

Hello! What does this program do? – NoOneIsHere – 2016-05-10T23:26:15.283

@NoOneIsHere Added ungolfed code with explanation. That should help. – Blab – 2016-05-11T00:51:43.563

If your last line is correct, your number should be ≈10^174,000,000 – Simply Beautiful Art – 2017-05-13T21:31:47.010