Prolific Perfect Pangram Programs Pertaining to Printable ASCII

Perl, 70*18446744073709551615*10^987654320

say q{!"#%&'+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\]^_`bcdfghijklmnoprtuvwz|}x(1e987654320*~$[)

Output:

!"#%&'+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\]^_`bcdfghijklmnoprtuvwz|

repeated 18446744073709551615*10^987654320 times.

$[ is by default 0, so ~$[ is equivalent to 18446744073709551615.

As a side note, I ran out of memory trying to create the number 10^987654320.


Old Answer (7703703696):

say qw(!"#$%&'*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcdefghijklmnoprtuvz{|}~10)x98765432

Output is:

!"#$%&'*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcdefghijklmnoprtuvz{|}~10

repeated 98765432 times.

Note: Run all samples with perl -Mbignum -E


GolfScript, over 2↑↑↑(9871↑↑2) chars

2 9871.?,{;0$[45)63]n+*~}/
#!"%&'(-:<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ\^_`abcdefghijklmopqrstuvwxyz|

Prints an integer. Take advantage of unlimited CPU register size (which determines the maximum string length in Ruby), memory and run time. The linefeed is solely for readability.

The code

2             # Push 2.
9871.?        # Push b := 9871↑↑2 = 9871↑9871 = 9871**9871.
,{            # For each i from 0 to b - 1:
  ;0$         #   Discard i and duplicate the integer on the stack.
  [45)63]n+*  #   Replicate ".?\n" that many times.
  ~           #   Evaluate.
 }/           #

The score

Define b = 9871↑↑2 (see Knuth's up-arrow notation).

  • .? executes f : x ↦ x↑x.

  • The inner block executes g : x ↦ fx(x).

    Since f(x) = x↑x = x↑↑2, f2(x) = (x↑x)↑(x↑x) > x↑x↑x = x↑↑3,
    f3(x) = ((x↑x)↑(x↑x))↑((x↑x)↑(x↑x)) > (x↑x↑x)↑(x↑x↑x) > x↑x↑x↑x = x↑↑4 and so forth, we have
    g(x) > x↑↑(x+1) > x↑↑x.

  • The outer block executes h : x ↦ gb(x).

    Since g(x) = x↑↑x = x↑↑↑2, g2(x) = (x↑↑x)↑↑(x↑↑x) > x↑↑x↑↑x = x↑↑↑3,
    g3(x) = ((x↑↑x)↑↑(x↑↑x))↑↑((x↑↑x)↑↑(x↑↑x)) > (x↑↑x↑↑x)↑(x↑↑x↑↑x) > x↑↑x↑↑x↑↑x = x↑↑↑4 and so forth, we have h(x) > x↑↑↑(b+1).

  • We start with the integer 2 on the stack, so the code calculates h(2) > 2↑↑↑(b+1).

  • The score is the number of decimal digits of h(2), which is log(h(2)) + 1 > log(2↑↑↑(b+1)) > 2↑↑↑b.

Thus, the score is larger than 2↑↑↑(9871↑↑2).

2↑↑↑n grows at a ridiculous pace as n gets larger. 2↑↑↑4 := 2↑↑2↑↑2↑↑2 = 2↑↑2↑↑4 = 2↑↑65536, which is a right-associative power tower of 65536 copies of 2:

                                                                2↑↑↑4                                                                 

Similarly, 2↑↑↑5 := 2↑↑(2↑↑↑4), which is a power tower of 2↑↑↑4 copies of 2.

Now, the score isn't 2↑↑↑4 or 2↑↑↑5, it's larger than 2↑↑↑b, where b > 2 × 1039 428. That's a big number...


Bash+coreutils, 151,888,888,888,888,905 (1.5*10^17)

seq 9E15;#\!%*+,-./2346780:=@ABCDFGHIJKLMNOPQRSTUVWXYZ]^_abcdfghijklmnoprtuvwxyz~"'$&()?<>`{}|[

Outputs integers 1 to 9x1015, one per line. Takes a long time.

Why 9E15? It turns out that GNU seq appears to use 64-bit floats (double) internally. The largest whole number we can represent with this type, before increment by one stops working due to lack of precision, is 253 or 9007199254740992. The closest we can get to this with exponential notation is 9E15 or 9000000000000000.

To calculate the score, I am using adding up all the numbers with a given number of digits and adding 9E15, because there is a newline between each number:

8000000000000001*16 + 900000000000000*15 + 90000000000000*14 + 9000000000000*13 + 900000000000*12 + 90000000000*11 + 9000000000*10 + 900000000*9 + 90000000*8 + 9000000*7 + 900000*6 + 90000*5 + 9000*4 + 900*3 + 90*2 + 9 + 9000000000000000

I could pipe this output through od for an extra order of magnitude or so, but that makes the score calculation much harder.


Pre-rule change answer:

Bash+coreutils, 18,926,221,380

seq 1592346780;#\!%*+,-./:=@ABCDEFGHIJKLMNOPQRSTUVWXYZ]^_abcdfghijklmnoprtuvwxyz~"'$&()?<>`{}|[

Outputs 1 to 1592346780. On my mid 2012 macbook (which is not that far off the linked benchmark), this takes about 9m45s.

I couldn't resist optimizing it a bit more, even though its probably meaningless.

Output:

$ time ./pangram.sh | wc
 1592346780 1592346780 18926221380

real    9m46.564s
user    11m7.419s
sys 0m10.974s
$