“Why do so many math majors confuse Halloween and Christmas?”/“Because OCT 31 = DEC 25.”

A popular math joke about Halloween and Christmas is:
 
Q: Why do programmers always get Christmas and Halloween mixed up?
A: Because DEC 25 = OCT 31!

 
That is, the number “25” (10 or decimal or DEC) is equal to the number “31” (8 or octal or OCT). The math joke was printed in Scientific American in November 1966, in the “Mathematical Games” column by Martin Gardner (1914-2010). The riddle form was posted to the newsgroup rec.humor on May 6, 1993.
   
     
Wikipedia: Mathematical joke
Another pun using different radices, sometimes attributed to computer scientists, asks:
 
Why do mathematicians confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.

 
The play on words lies in the similarity of the abbreviation for October/Octal and December/Decimal, and the coincidence that both equal the same amount ( {\displaystyle 31_{8}=25_{10}} 31_{8}=25_{10}).
 
November 1966, Scientific American, “Mathematical Games” by Martin Gardner, pg. 143:
Oct. 31 = Dec. 25 if “Oct.” and “Dec.” are taken as abbreviations for the octal and decimal systems. The number 31, in a system based on 8, is written 25 in a system based on 10.
     
Google Books
December 1966, Scientific American, “Mathematical Games” by Martin Gardner, pg. 132:
John Friedlein, who teaches mathematics at a high school in St. Charles, Ill., observed that not only does Christmas equal Halloween, as pointed out last month (Dec. 25 = Oct. 31 when the abbreviations are taken for the decimal and octal systems), but also Thanksgiving if it falls, as it sometimes does, on November 27.
 
Google Books
Beyond Language:
Adventures in Word and Thought

By Dmitri A. Borgmann
New York, NY: Scribner
1967
Pg. 217:
HALLOWEEN AND CHRISTMAS
Halloween is celebrated on the 31st of October, Christmas on the 25th of December. Translating these dates into standard calendar notation gives us two equations:
 
Halloween = Oct 31
Christmas = Dec 25
 
In the Decimal System of notation (Dec), the number 25 is that number which is written as 31 in the Octal System of notation (Oct).
   
Google Groups: rec.humor
Computer Jokes…
Rosalind C Gray
5/6/93
Q: Why do programmers always get Christmas and Halloween mixed up?
A: Because DEC 25 = OCT 31!
   
Google Groups: rec.humor
Computer Questions
Peter Piacenza
6/14/94
(...)
Q: Why do programmers always get Christmas and Halloween mixed up?
A: Because DEC 25 = OCT 31
 
Google Groups: rec.humor
Canonical List Of Computer Humor
The BANDIT
6/20/94
(...)
Q: Why do programmers always get Christmas and Halloween mixed up?
A: Because DEC 25 = OCT 31
 
Google Groups: alt.religion.w-w-church-god     
Why do Programmers confuse Halloween and Christmas? (Was Re: Should Halloween be on a Christian Calendar?)
Tom
12/8/98
Because OCT(31) = DEC(25);
 
Google Books
Applying UML and Patterns:
An Introduction to Object-Oriented Analysis and Design and the Unified Process

By Craig Larman
Upper Saddle River, NJ: Prentice-Hall
2002
Pg. 385:
Why do programmers get Halloween and Christmas mixed up? Because OCT(31) = DEC(25).
 
Google Books
Are You a Geek?
By Tim Collins
New York, NY: Random House
2006
Pg. 78:
Why do programmer mix up Halloween and Christmas? Because OCt 31 = DEC 25.
 
Twitter
dan bach
‏@dansmath
daily math joke #5 - q: why do computer scientists get halloween and christmas mixed up?  a: because oct. 31 = dec. 25. (p.s. octal/decimal)
12:09 PM - 7 Jan 2009
 
Twitter
irc
‏@irc
Why do so many math majors confuse Halloween and Christmas? why?

Because Oct 31 is Dec 25
12:48 PM - 30 Apr 2009
 
Twitter
Hourly Facts
‏@factstorm
Why do so many math majors confuse Hall…- Why do so many math majors confuse Halloween and Christmas?
Because Oct… http://bit.ly/fXAEA
5:42 PM - 19 Jun 2009
   
iD Tech
Part I: Top 10 Programmer Jokes, Explained for the Rest of Us
by: Kendall on March 13, 2014
1. Why do programmers always mix up Halloween and Christmas? Because Oct 31 = Dec 25.
(...)
Decimal is the base-10 number system that everyone is familiar with. A number system has as many digits as its base number. That means a base-10 number system 10 digits (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) and is where it gets its name from (decimal, from Latin decimus, means tenth).
 
When you get to a number that is higher than the highest digit, you add another column to the left, so you count like 8, 9, 10, 11, 12, and so on.
 
Octal (from the Latin root oct- meaning eight) is a base-8 number system commonly used in programming. A base-8 system means it has 8 digits (0, 1, 2, 3, 4, 5, 6, and 7). When you get to a number higher than 7, you also add another column, so you count like 6, 7, 10, 11, 12, and so on.
 
If we convert the octal 31 to decimal, we end up with 25.