Arithmetic Billiards

Number theory revealed through billiard ball paths

The Connection

A billiard ball fired at 45° in an a×b rectangle bounces until it reaches a corner. The path encodes deep number theory:

Bounces = a + b − 2
Path segments = LCM(a,b)/GCD(a,b)
GCD visible as grid symmetry
Reaches corner ↔ a,b both odd or both even… or always (45°)

The number of bounces off horizontal walls is a−1, vertical walls is b−1. Total = a+b−2.

GCD(a,b)
LCM(a,b)
Total bounces
Segments
Exit corner
Try a=7,b=5 (GCD=1) — fills richly.
Try a=6,b=4 (GCD=2) — symmetric.
Try a=12,b=8 — notice patterns!