Each of the three permission classes holds three bits, so a class can show 0 to 7 and a mode can show eight digits' worth of information in three characters. A 7 is read plus write plus execute, and 777 therefore turns all nine bits on: 7 × 64 + 7 × 8 + 7 = 511 (first link), which is 2⁹ − 1 (second link) and, in the third link's converter, 777 octal, 1FF hexadecimal and 111111111 binary. The same digits, three different place values, one number — which is exactly the reason octal survived into a hexadecimal world.
Three bits per digit is the whole of octal's argument, and it came from machines whose words were 12 or 18 bits, four or six octal digits long, so an address could be read off in groups. On a modern system the base has no job left except this one file: a binary number is unreadable at length, hexadecimal groups four bits and so splits bytes but not permission triples, and octal splits three, which is what chmod asks for. Two consequences are worth keeping. The mode is usually four digits rather than three, because the leading digit holds setuid, setgid and the sticky bit, and 4755 is a set-root binary, not a different animal. And the default 644 for a new file is 666 with the umask 022 subtracted from it, which is why a freshly written script is not executable until somebody says so — a permission system whose most common operation is a subtraction, done in a base chosen in 1970 for the sake of the PDP-11.
Answer
511
How to read it
7·64 + 7·8 + 7 on the workbench. The second link is the same number as nine bits set, the third shows the four bases side by side.
Source
Unix file mode bits — read 4, write 2, execute 1, for owner, group and other; octal notation is the legacy of the 12- and 18-bit PDP machines whose words group in threes, and the fourth digit carries setuid, setgid and sticky
Work it in the calculator
These links open the right calculator with this problem's numbers already typed in. The line above is what the screen should show — check it yourself.