Skip to content

Instantly share code, notes, and snippets.

@rogerallen
Last active September 12, 2021 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogerallen/b4cef06f1ad3e9a8792d5080f7379b9c to your computer and use it in GitHub Desktop.
Save rogerallen/b4cef06f1ad3e9a8792d5080f7379b9c to your computer and use it in GitHub Desktop.
Oregon State West Hall Dorm Math Series
At Oregon State University, when you walk into West Hall, there is a series of numbers written on
the walls, near the ceiling.
The numbers are:
3 7 31 127 [EXIT sign] 8191 131071 524287 8388607 536870911 2147483647 137438953471 2199023255551
8796093022207 140737488355327 9007199254740991 576460752303423487 2305843009213693951
There is nothing else describing the numbers. I wondered what they were & figured it out below.
----- SPOILERS BELOW -----
Below is a program that produces the following output:
2 3
3 7
5 31
7 127
11 2047 [indeed the EXIT sign covers something]
13 8191
17 131071
19 524287
23 8388607
29 536870911
31 2147483647
37 137438953471
41 2199023255551
43 8796093022207
47 140737488355327
53 9007199254740991
59 576460752303423487
61 2305843009213693951
So, the series is 2^p - 1 where p are the primes.
I checked via this Python code:
>>> for p in [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61]:
... print(p,(2**p)-1)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment