One of the oldest surviving fragments of Euclid’s Elements found at Oxyrhynchus, Egypt. It was in this book that Euclid explained his algorithm to find the greatest common divisor of two numbers. This fragment was discovered in 1896 and now resides at the University of Pennsylvania.

Today’s post is going to break down an algorithm in JavaScript that finds the least common multiple of a range of numbers. I’ll be explaining both a basic solution that uses multiple loops and an optimized solution that makes use of both recursion and the Euclidean algorithm.

The Challenge

First, let’s take…

Before I began my current efforts to study programming, much of my academic and professional background was in historical research. While some history research does involve the idealized scene of going through centuries old documents at archives or examining artifacts at museums, the most efficient and effective research methods include…

Computers. They’re a ubiquitous part of the 21st century. Smartphones, iPods, tablets, laptops, desktops, televisions, modern vehicles, appliances, cameras, traffic lights, and innumerable other machines function because of some form of computer technology. In addition, the answer to countless questions are only a quick search away via the internet. Even…

This photo was taken near First Arizona State Governor George W.P. Hunt’s tomb with Camelback Mountain, some of the Papago Buttes, and one of the park’s artificial lakes seen amidst the desert plants and palm trees.

The oddly shaped buttes of Papago Park are easily recognized natural landmarks within central Arizona. The park preserves a small piece of the Sonoran Desert within the urban metropolis that is Phoenix, Arizona and its suburbs. The land is shared between two cities with most of Papago Park located in…

Standing on the summit of Piestewa Peak at 2,610 feet (796 meters) on one of my many hikes to the top. The photo was taken from the second highest point on the mountain a short distance away. Camelback Mountain can be seen in the distance to the left.

Piestewa Peak is one of my favorite day hikes in the Phoenix area. Located in the center of a major metropolitan area, the trail is one of the most visited in the nation with 4,000 to 10,000 hikers on any given week.¹ …

Austin William Smith

Historian | Full Stack Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store