Digits with distinct pairwise sums

What is the largest nn for which there exists an nn-digit number whose digits are distinct and have all distinct pairwise sums? (For n=3n = 3, e.g. 174174 works since 1+71+7, 1+41+4, 7+47+4 are all different.)

Show hints (2)+
  1. Two disjoint pairs have equal sums exactly when they have equal differences.
  2. A difference dd can appear at most twice (as a chain x,x+d,x+2dx, x+d, x+2d), and only once if d≥5d \ge 5. Count how many pairs that allows.

Answer

Reveal answer →

5

Create a free account to see the full worked solution and track your progress.

Interview format: Market Maker, Systematic & Data-Driven Trading

Related questions