The wash sale rule is the loss-disallowance provision at section 1091 of the Internal Revenue Code, headed "Loss from wash sales of stock or securities." Its operative sentence is precise about timing: no deduction is allowed for a loss where, "within a period beginning 30 days before the date of such sale or disposition and ending 30 days after such date," the taxpayer has acquired, or entered into a contract or option to acquire, substantially identical stock or securities. Counting the day of the sale, that is a 61-day window, and half of it sits in the past.
The rule exists to stop a purely paper loss. Selling a holding and immediately buying it back leaves the investor in the same economic position while producing a deduction, so the code declines to recognize the loss. What it does instead is the part most explanations skip, and it is the difference between a lost deduction and a delayed one.