OFFSET
2,1
COMMENTS
This sequence stems from the property of the multinomial function that states that multinomial(p*a + r, p*b + s, p*c + t) = multinomial(a, b, c) * multinomial(r, s, t) mod p for all a >= 0, b >= 0, c >= 0, and r, s, t in the set {0, 1, ..., p-1}. a(n) is the number of such triples (r, s, t) for which this congruence also holds modulo p^2 for all a >= 0, b >= 0, and c >= 0, where p is the n-th prime.
Equivalently, a(n) is the number of triples (r, s, t) of integers such that 0 <= r, s, t <= p-1 and either r + s + t >= 2*p or H(r) = H(s) = H(t) = H(r + s + t) mod p, where H(n) is the n-th harmonic number and p is the n-th prime. Note that the latter case here implies that r + s + t <= p-1, as otherwise the expression H(r + s + t) mod p would be undefined. This restriction shows why these two cases can never overlap.
Geometrically, the set of triples (r, s, t) of integers such that 0 <= r, s, t <= p-1 and r + s + t >= 2*p creates a tetrahedron of points of height p - 2 (regardless of whether or not p is prime). It comes from the region in 3-space inside a cube and below a diagonal plane. As a result, the cardinality of this set must be equal to p * (p - 1) * (p - 2) / 6.
EXAMPLE
For n = 3, p will be 5, and there are exactly a(3) = 15 triples of the form (r, s, t) that satisfy the desired properties that 0 <= r, s, t <= 4 and either r + s + t >= 10 or H(r) = H(s) = H(t) = H(r + s + t) mod 5: (0, 0, 0), (0, 0, 4), (0, 4, 0), (1, 1, 1), (2, 4, 4), (3, 3, 4), (3, 4, 3), (3, 4, 4), (4, 0, 0), (4, 2, 4), (4, 3, 3), (4, 3, 4), (4, 4, 2), (4, 4, 3), and (4, 4, 4).
MATHEMATICA
Table[Length[
Table[If[Plus @@ k >= p, Nothing,
If[Equal @@
Expand[{HarmonicNumber[k[[1]]], HarmonicNumber[k[[2]]],
HarmonicNumber[k[[3]]],
HarmonicNumber[k[[1]] + k[[2]] + k[[3]]]}, Modulus -> p], k,
Nothing]], {k, Tuples[Range[p] - 1, 3]}]] +
p*(p - 1)*(p - 2)/6, {p, Prime[Range[5]]}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Joshua Crisafi, Nov 12 2021
STATUS
approved