Here is the Verbose version of the Generalized Quasi-Polynomial Capsule for \ the coefficient of q^(17*n+16) mod 17 functional equation 17 q f(q ) f(q) = 1 + ------------------- 5 2 3 (1 - q) (-q + 1) ----------------------------------------------------------------------------\ ----------------- A Fast (Log Time!) Way to Determine the Remainder Upon Dividing by, 17, (17 n + 16) of the coefficient of, q in the Unique Formal Power Series Satisfying the Functional Equation 17 q f(q ) f(q) = 1 + ------------------- 5 2 3 (1 - q) (-q + 1) By Shalosh B. Ekhad Theorem: Let c(n) be the coefficient of q^n in the formal power series of th\ e title, in other words let infinity ----- \ n f(q) = ) c(n) q / ----- n = 0 is the unique formal power series satisfying the inhomogeneneous functional \ equation: 17 q f(q ) f(q) = 1 + ------------------- 5 2 3 (1 - q) (-q + 1) Let , d(n), be , c(17 n + 16) Define , 23, integers as follows: C[0] = 0, C[1] = 1, C[2] = 5, C[3] = 2, C[4] = 4, C[5] = 4, C[6] = 10, C[7] = 14, C[8] = 9, C[9] = 7, C[10] = 5, C[11] = 7, C[12] = 7, C[13] = 5, C[14] = 7, C[15] = 9, C[16] = 14, C[17] = 10, C[18] = 4, C[19] = 4, C[20] = 2, C[21] = 5, C[22] = 1 If j is larger then, 22, then C[j]=0 Also let Q(n) be the quasi-polynomial of quasi-period, 2, such that 410338673 7 989640329 6 if n modulo, 2, is , 0, then Q(n) equals , --------- n + --------- n 40320 11520 3568100641 5 44516693 4 2125417843 3 379216841 2 43700047 + ---------- n + -------- n + ---------- n + --------- n + -------- n 11520 72 2880 720 210 + 35112 6067482461 2 4494545 if n modulo, 2, is , 1, then Q(n) equals , ---------- n + ------- 11520 128 2125417843 3 44516693 4 3568100641 5 989640329 6 + ---------- n + -------- n + ---------- n + --------- n 2880 72 11520 11520 410338673 7 5593679201 + --------- n + ---------- n 40320 26880 d(n) modulo, 17, can be computed VERY fast (in logarithmic time!) using the f\ ollowing recurrence, taken modulo, 17 d(17 n + a) = Q(17 n + a) + C[a] d(n) + C[a + 17] d(n - 1) subject to the initial condition d(0) = 7, d(1) = 7, d(2) = 8, d(3) = 14, d(4) = 1, d(5) = 11, d(6) = 9, d(7) = 13, d(8) = 2, d(9) = 15, d(10) = 8, d(11) = 15, d(12) = 5, d(13) = 1, d(14) = 5, d(15) = 12, d(16) = 3, d(17) = 2, d(18) = 8, d(19) = 12, d(20) = 1, d(21) = 12, d(22) = 8 Just for fun the googol-th through googol+100-th terms of d(n) modulo, 17, is 5, 6, 4, 6, 13, 14, 13, 15, 2, 11, 13, 9, 9, 0, 6, 16, 9, 11, 8, 8, 8, 1, 15, 1, 1, 2, 6, 14, 14, 15, 8, 15, 15, 1, 4, 9, 11, 9, 16, 4, 16, 14, 8, 8, 10, 9, 15, 10, 7, 15, 11, 5, 9, 16, 9, 2, 6, 2, 12, 4, 5, 8, 6, 7, 14, 1, 10, 11, 8, 14, 0, 14, 4, 10, 4, 1, 1, 3, 6, 14, 10, 8, 7, 12, 0, 4, 12, 6, 12, 5, 13, 5, 11, 10, 2, 2, 8, 7, 12, 7, 13 ----------------------------------------------------------------------------\ ----------------- This took, 0.738, seconds, ----------------------------------------------------------------------------\ ----------------- This took, 0.759, seconds.