May 5, 2026 Final

Problem 3 · Zigzag numbers

Combinatorics: up-down patterns with four distinct digits.

Integer answer, at most 4 digits

A positive integer is called a zigzag number if it satisfies the following three conditions:

  1. Its digits are nonzero and all different.
  2. It has no three consecutive digits in ascending order.
  3. It has no three consecutive digits in descending order.

For example, 14385 and 2917 are zigzag numbers but 2564 and 71544 are not. How many four-digit zigzag numbers are there?

Copa Cangur · SCM Hard Closed answer