Skip over navigation
Cambridge University Faculty of Mathematics NRich logo
menu search
  • Teachers expand_more
    • Early years
    • Primary
    • Secondary
    • Post-16
    • Events
    • Professional development
  • Students expand_more
    • Primary
    • Secondary
    • Post-16
  • Parents expand_more
    • Early Years
    • Primary
    • Secondary
    • Post-16
  • Problem-Solving Schools
  • About NRICH expand_more
    • About us
    • Impact stories
    • Support us
    • Our funders
    • Contact us
  • search

Or search by topic

Number and algebra

  • The Number System and Place Value
  • Calculations and Numerical Methods
  • Fractions, Decimals, Percentages, Ratio and Proportion
  • Properties of Numbers
  • Patterns, Sequences and Structure
  • Algebraic expressions, equations and formulae
  • Coordinates, Functions and Graphs

Geometry and measure

  • Angles, Polygons, and Geometrical Proof
  • 3D Geometry, Shape and Space
  • Measuring and calculating with units
  • Transformations and constructions
  • Pythagoras and Trigonometry
  • Vectors and Matrices

Probability and statistics

  • Handling, Processing and Representing Data
  • Probability

Working mathematically

  • Thinking mathematically
  • Developing positive attitudes
  • Cross-curricular contexts

Advanced mathematics

  • Decision Mathematics and Combinatorics
  • Advanced Probability and Statistics
  • Mechanics
  • Calculus

For younger learners

  • Early Years Foundation Stage
Age 11 to 18
Article by Adam Huby and Paul Cockayne

Published 2000 Revised 2012

Impossible Sandwiches

In September 1997 we published the following puzzle called Sandwiches. Paul Cockayne's delightful, simple and completely general proof about when solutions exist and when they do not exist has just been contributed by Alan Parr from his games magazine 'Hopscotch'.

If you have not tried this puzzle before you may like to have a go at it before reading Paul's solution below or referring to the other solutions in the NRICH Archive.

Here is the puzzle:

Suppose you have two 1s, two 2s and two 3s. Arrange these six digits in a list so that:

  • between the two 1s there is one digit giving 1?1,
  • between the two 2s there are two digits giving 2??2,
  • and between the two 3s there are three digits giving 3???3.

Can you do the same if you only have 1s and 2s? Explain your answer.

Can you do the same if you include two fours, and between the two 4s there are four digits?

Here is a solution using 5s, 6s and 7s as well: 71316435724625. Find other solutions with all these digits.

Here is Paul Cockayne's stunningly simple proof that solutions only exist for n=4m or n=4m-1..... To make the terminology a bit simpler, colour digits in the "solution number" or "sandwich", alternately red and blue:.

Then all odd numbers in the solution number will be either both red or both blue. Even numbers will always be one red, one blue. Since the final solution contains an equal number of red and blue digits, the problem is only soluble if we have an even number of odd numbers.

The only n-sandwiches which have an even number of odd numbers are those where n is a multiple of 4 or 1 less than a multiple of 4. (For example 9-sandwiches don't exist because if they did they would contain 1s, 3s, 5s, 7s and 9s)

Obvious, isn't it?

Finally, just to prove that he had done it, Adam Huby gave the following solution for n = 67.

67 65 66 62 60 64 57 63 54 52 61 49 47 59 44 58 41 39 56 36 55 33 30 53 26 24 51 20 50 5 9 48 10 12 46 5 45 7 3 43 9 42 3 10 40 7 12 38 20 37 24 26 35 30 34 33 36 39 41 44 47 49 52 54 57 60 62 65 67 66 64 63 61 59 58 56 55 53 51 50 48 46 45 43 42 40 38 37 35 34 32 29 31 28 25 23 21 27 18 6 13 11 8 22 4 2 6 19 2 4 17 8 16 11 13 14 15 18 21 23 25 29 28 32 31 27 22 19 17 16 14 1 15 1

Related Collections

  • More Stage 5 Students Articles

You may also like

Summats Clear

Find the sum, f(n), of the first n terms of the sequence: 0, 1, 1, 2, 2, 3, 3........p, p, p +1, p + 1,..... Prove that f(a + b) - f(a - b) = ab.

Score

There are exactly 3 ways to add 4 odd numbers to get 10. Find all the ways of adding 8 odd numbers to get 20. To be sure of getting all the solutions you will need to be systematic. What about a total of 15 with 6 odd numbers?

Comparing Continued Fractions

Which of these continued fractions is bigger and why?

  • Tech help
  • Accessibility Statement
  • Sign up to our newsletter
  • Twitter X logo

The NRICH Project aims to enrich the mathematical experiences of all learners. To support this aim, members of the NRICH team work in a wide range of capacities, including providing professional development for teachers wishing to embed rich mathematical tasks into everyday classroom practice.

NRICH is part of the family of activities in the Millennium Mathematics Project.

University of Cambridge logo NRICH logo