Problem

Source: USA January TST for IMO 2016, Problem 2

Tags: algebra, functional equation



Let $n \ge 4$ be an integer. Find all functions $W : \{1, \dots, n\}^2 \to \mathbb R$ such that for every partition $[n] = A \cup B \cup C$ into disjoint sets, \[ \sum_{a \in A} \sum_{b \in B} \sum_{c \in C} W(a,b) W(b,c) = |A| |B| |C|. \]