The desired count is 1953!2016!−63!⋅2016, which we compute using the principle of inclusion-exclusion. As in A2, we use the fact that 2017 is prime; this means that we can do linear algebra over the field F2017. In particular, every nonzero homogeneous linear equation in n variables over F2017hasexactly2017^{n-1}solutions.Forπapartitionof{0,…,63},let∣π∣ denote the number of distinct parts of π,Letπ0denotethepartitionof{0,…,63}into64singletonparts.Letπ1denotethepartitionof{0,…,63} into one 64-element part. For π,σtwopartitionsof{0,…,63},writeπ∣σifπisarefinementofσ(thatis,everypartinσisaunionofpartsinπ).Byinductionon∣π∣,wemayconstructacollectionofintegersμπ,oneforeachπ, with the properties that [ | = 1 = 0 0 0 . ] Define the sequencec_0, …,c63bysettingc_0 = 1andc_i = ifori>1.LetNπbethenumberofordered64−tuples(x0,…,x63)ofelementsofF2017 such that xi=xj whenever i and j belong to the same part and ∑i=063cixi is divisible by 2017. Then Nπ equals 2017∣π∣−1 unless for each part S of π, the sum ∑i∈Sci vanishes; in that case, Nπ instead equals 2017∣π∣. Since c0,…,c63 are positive integers which sum to 1+263⋅64=2017, the second outcome only occurs for π=π1. By inclusion-exclusion, the desired count may be written as π∑μπNπ=2016⋅μπ1+π∑μπ2017∣π∣−1. Similarly, the number of ordered 64-tuples with no repeated elements may be written as 64!(642017)=π∑μπ2017∣π∣. The desired quantity may thus be written as 1953!2016!+2016μπ1. It remains to compute μπ1. We adopt an approach suggested by David Savitt: apply inclusion-exclusion to count distinct 64-tuples in an arbitrary set A. As above, this yields ∣A∣(∣A∣−1)⋯(∣A∣−63)=π∑μπ∣A∣∣π∣. Viewing both sides as polynomials in ∣A∣ and comparing coefficients in degree 1 yields μπ=−63! and thus the claimed answer.