Print a string in as few distinct characters as possible

Lua, 8 distinct characters

load"load\"load\\\"load\\\\\\\"load\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\5\50\\5\55\\\\0
\\5\50\\05\55\50\\\\\\\\\\\\\\5\50\\5\55\\\\0\\5\50\\5\55\\5\50\\\\\\\\\\\\0\\5\
50\\05\05505\\\\\\\\\\\\\\5\50\\5\55\\\\0\\5\50\\05\0550\\\\\\\\\\\\\\5\50\\5\55
\\\\\\5\50\\5\55\\\\5\\5\50\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\
\\\05\\\\05\\5\50\\5\50\\\\\\\\\\\\0\\5\50\\05\0550\\5\50\\\\\\\\\\\\0\\5\50\\05
\0550\\\\\\5\50\\5\55\\\\\\\\\\\\\\\\\\\\\\\\05\\\\0\\5\50\\05\55\50\\\\\\\\\\\\
\\\\\\\\\\5\50\\5\55\\\\\\5\50\\5\55\\\\\\\\5\\\\\\5\50\\5\55\\\\\\\\\\\\\\5\50\
\5\55\\\\0\\5\50\\05\55\55\\\\\\\\\\\\0\\5\50\\05\05505\\\\\\5\55\\5\55\\\\\\\\\
\\\0\\5\50\\05\0550\55\\\\\\\\\\\\\\\\\\\\\\\\05\\\\0\\5\50\\05\55\50\\\\\\\\\\\
\\\\\\\5\55\\\\\\\\5\\\\5\\5\50\\\\\\\\\\\\\\5\50\\5\55\\\\0\\5\50\\5\55\\5\50o\
\\\\\\\\\\\\\5\50\\5\55\\\\0\\5\50\\5\55\\5\55\\\\\\\\\\\\\\5\50\\5\55\\\\0\\5\5
0\\05\0550\\\\\\\\\\\\\\\\\\\\\\\\05\\\\0\\5\50\\05\55\50\\\\\\\\\\\\0\\5\50\\05
\0550\50o\\\\\\\\\\\\0\\5\50\\05\55\0500\\\\\\\\\\\\\\\\\\\\\\\\05\\\\0\\5\50\\0
5\55\50\\\\\\\\\\\\0\\5\50\\05\0550\\\\5\\5\50\\\\\\\\\\\\\\5\50\\5\55\\\\0\\5\5
0\\05\55\55\\\\\\\\\\\\0\\5\50\\05\0550\\5\55\\\\\\\\\\\\\\5\50\\5\55\\\\0\\5\50
\\05\55\50\\\\\\\\\\\\\\5\50\\5\55\\\\0\\5\50\\05\0555\\\\\\\\\\\\\\\\\\\\\\\\05
\\\\0\\5\50\\05\55\50o\\\\\\\\\\\\\\\\\\\\\\5\50\\5\55\\\\\\5\50\\5\55\\\\\\\\5\
\\\5\\5\50\\\\\\\\\\\\0\\5\50\\05\0550\\\\\\5\50\\5\55\\\\\\\\\\\\\\5\50\\5\55\\
\\0\\5\50\\5\55\\5\50\\\\\\\\\\\\\\\\\\\\\\\\05\\\\0\\5\50\\05\55\50\\\\\\\\\\\\
\\5\50\\5\55\\\\\\5\50\\5\55\\\\5\\5\50\\\\\\\\\\\\0\\5\50\\05\0550\\5\50\\\\\\\
\\\\\0\\5\50\\05\0550\\\\\\5\50\\5\55\\\\\\\\\\\\\\\\\\\\\\\\05\\\\0\\5\50\\05\5
5\50la\\\\\\\\\\\\0\\5\50\\05\55\50\50\\\\\\\\\\\\0\\5\50\\05\55\50\\\\\\5\50\\5
\55\\\\\\\\\\\\\\\\\\\\\\\\05\\\\0\\5\50\\05\55\50do\\\\\\\\\\\\\\\\\\\\0\\5\50\
\05\0550\\\\\\\\5\\\\\\5\50\\5\55\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\
"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\\\\\"\\\\\\\"\\\"\\\"\\\"\"\"\""""

All newline characters must be removed from this code to get single line of length 1998.
Lua 5.2 required


How arbitrary Lua program could be written using only 8 characters load"\05

Having chars 05\, it is possible to write string literal for any string consisting of chars 0257\. Indeed, "\\" means backslash, "2" == "\50" and "7" == "\55" ("\ddd" in Lua means char with decimal code ddd).
Having chars 0257\, it is possible to write string literal for any string consisting of chars 024579\ (as "4" == "\52" and "9" == "\57")
On the next step chars 01245679\ will become available.
One more step is required to get all decimal digits.

Lua has function load which treats a string as Lua code and converts it to a function.
E.g., load("print\"Hello\"")() prints Hello.
It could be written without parentheses: load"print\"Hello\"""" (last two quotes mean empty string which is passed as optional parameter to the function).
Any Lua program could be converted to reduced alphabet within at most 5 steps.
Example: If our program consists of single digit 9, then only two steps are required:
step 0: 9
step 1: load"\57"""
step 2: load"load\"\\5\55\"\"\""""


64-bit Intel machine code for Linux in binary: 2 distinct characters

01111111010001010100110001000110000000100000000100000001000000000000000000000000
00000000000000000000000000000000000000000000000000000010000000000011111000000000
00000001000000000000000000000000011110000000000001000000000000000000000000000000
00000000000000000100000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000100000000000000001110000000000000000001000000000000000000000000
00000000000000000000000000000000000000010000000000000000000000000000010100000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000100000000000000000000000000000000000000000000000000000000000000
01000000000000000000000000000000000000000000000011001011000000000000000000000000
00000000000000000000000000000000110010110000000000000000000000000000000000000000
00000000000000000000000000000000001000000000000000000000000000000000000000000000
10111000000000010000000000000000000000001011111100000001000000000000000000000000
01001000101111101001111100000000010000000000000000000000000000000000000000000000
10111010001011000000000000000000000000000000111100000101101110000011110000000000
00000000000000001011111100000000000000000000000000000000000011110000010101010100
01101000011001010010000001110001011101010110100101100011011010110010000001100010
01110010011011110111011101101110001000000110011001101111011110000010000001101010
01110101011011010111000001110011001000000110111101110110011001010111001000100000
01110100011010000110010100100000011011000110000101111010011110010010000001100100
011011110110011100001010

I refuse to rewrite it in unary.


Python, 9

Using this idea. (The line breaks are there for readability and can be removed.)

exec(chr(111+1)+chr(111+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)+chr(11
+11+11+11+11+11+11+11+11+11)+chr(111+1+1+1+1+1)+chr(11+11+11+1)+chr(11+11+11+11
+11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1)+chr(11+11+11+
11+11+11+11+11+11+1+1)+chr(11+11+1+1+1+1+1+1+1+1+1+1)+chr(111+1+1)+chr(111+1+1+1
+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+
11)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1)+chr(11+11+1+1+1+1+1+1+1+1+1+
1)+chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1)+chr(111+1+1+1)+chr(111)+chr(
111+1+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+11)+chr(11+11+1+1+1+1+1+1+1+
1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1)+chr(111)+chr(111+1+1+1+1+1+1+1+1+1)
+chr(11+11+1+1+1+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1)+chr
(111+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1)+chr(111+1
)+chr(111+1+1+1+1)+chr(11+11+1+1+1+1+1+1+1+1+1+1)+chr(111)+chr(111+1+1+1+1+1+1+1
)+chr(11+11+11+11+11+11+11+11+11+1+1)+chr(111+1+1+1)+chr(11+11+1+1+1+1+1+1+1+1+1
+1)+chr(111+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1)+chr(11+11+11+11
+11+11+11+11+11+1+1)+chr(11+11+1+1+1+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+
11+1+1+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1)+chr(111+11)
+chr(111+1+1+1+1+1+1+1+1+1+1)+chr(11+11+1+1+1+1+1+1+1+1+1+1)+chr(11+11+11+11+11+
11+11+11+11+1)+chr(111)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1)+chr(11+11+11+1))

This builds the string 'print"The quick brown fox jumps over the lazy dog"' and executes it.