Two children, Matilda and Labrun, live on a street in which—unlike many streets in the U.S.—the houses on one side are numbered consecutively, starting at 1. They notice that the sum of the numbers on the houses to the left of theirs equals the sum of the numbers to the right.
Write a function that takes nmax, the maximum number of houses on the street, and returns the largest possible number of houses and the number of the house where the family of Matilda and Labrun lives. For example, if nmax = 10, then the function should find that the street has 8 houses and Matilda and Labrun live in house 6 because 1+2+3+4+5 = 7+8 = 15.
Henry Dudeney posed a version of this problem in Strand Magazine in the early part of the 20th century. Although the connections might not be immediately clear, you might try Cody Problems 1215, 8057, and 45253 as well.

Solution Stats

460 Solutions

22 Solvers

Last Solution submitted on Jan 19, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...