Skip to main content.

Second hint to puzzle 106: Flying cards

There are 252 equally likely configurations of face up/face down.  We seek the number of configurations for which the sum of face up card values is divisible by 13.

Consider the generating function
f(x) = (1 + x)4(1 + x2)4...(1 + x13)4 = a0 + a1x + a2x2 ... + a364x364.

Each exponent in the generating function represents a total score, and the corresponding coefficient represents the number of ways of obtaining that score.

Hence we seek the sum S = a0 + a13 + ... + a364.
Let w be a (complex) primitive 13th root of unity.  Then w13 = 1 and 1 + w + w2 + ... + w12 = 0.