login
A381350
Number of subsets of 8 integers between 1 and n such that their sum is 2 modulo n.
1
1, 5, 15, 42, 99, 217, 429, 808, 1430, 2438, 3978, 6308, 9690, 14550, 21318, 30664, 43263, 60115, 82225, 111038, 148005, 195143, 254475, 328752, 420732, 534076, 672452, 840648, 1043460, 1287036, 1577532, 1922736, 2330445, 2810385, 3372291, 4028178, 4790071, 5672645
OFFSET
9,2
COMMENTS
For s an integer such that GCD(s,8)=2, this is also the number of subsets of 8 integers between 1 and n such that their sum is s modulo n.
LINKS
David Broadhurst and Xavier Roulleau, Number of partitions of modular integers, arXiv:2502.19523 [math.NT], 2025.
Index entries for linear recurrences with constant coefficients, signature (4,-4,-4,12,-12,4,12,-22,12,4,-12,12,-4,-4,4,-1).
FORMULA
G.f.: x^9*(1 + x - x^2 + 6*x^3 + 2*x^5 + 6*x^7 - x^8 + x^9 + x^10)/((1 - x)^4*(1 - x^2)^2*(1 - x^4)*(1 - x^8)).
a(n) = (n - 4)*(2520 - 24*(281 + 35*(-1)^n)*n + 5*(1039 + 21*(-1)^n)*n^2 - 2112*n^3 + 452*n^4 - 48*n^5 + 2*n^6 - 2520*A056594(n))/80640. - Stefano Spezia, Feb 21 2025
EXAMPLE
For n=10, there are a(10)=5 order 8 subsets of Z/10Z with sum equal to 2 mod 10.
MATHEMATICA
Drop[CoefficientList[Series[x^9(1+x-x^2+6x^3+2x^5+6x^7-x^8+x^9+x^10)/((1-x)^4(1-x^2)^2(1-x^4)(1-x^8)), {x, 0, 50}], x], 9] (* Harvey P. Dale, Feb 22 2026 *)
(* Alternative: *)
LinearRecurrence[{4, -4, -4, 12, -12, 4, 12, -22, 12, 4, -12, 12, -4, -4, 4, -1}, {1, 5, 15, 42, 99, 217, 429, 808, 1430, 2438, 3978, 6308, 9690, 14550, 21318, 30664}, 40] (* Harvey P. Dale, Feb 22 2026 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Xavier Roulleau, Feb 21 2025
STATUS
approved