Sylvester's Postage Stamp Problem

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

What is the greatest positive integer such that the Diophantine equation has no solution in non-negative integers? If and are relatively prime numbers, the equation has a solution in integers for any integer and has a solution in non-negative integers for any integer greater than .

Contributed by: Izidor Hafner (December 2012)
Open content licensed under CC BY-NC-SA



J. J. Sylvester (1814–1897) posed the problem of finding the largest number that cannot be made up of some combination of 5p and 17p stamps.


[1] D. Wells, The Penguin Book of Curious and Interesting Puzzles, New York: Penguin Books, 1993 p. 64.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.