The Number of Ways of Having n Coins in Your Two pockets, with denominatio\ ns in the set, {1, 5, 10, 25}, in such a way That both pockets carry the same amount By Shalosh B. Ekhad Theorem: Let a(n) be the number of ways of having n Coins in your two\ pockets, with denominations in the set, {1, 5, 10, 25}, in such a way that both pockets carry the same amount , then infinity ----- \ n 54 53 52 51 50 49 48 ) a(n) t = - (t + t + 3 t + 4 t + 9 t + 15 t + 25 t / ----- n = 0 47 46 45 44 43 42 41 + 37 t + 54 t + 76 t + 101 t + 128 t + 158 t + 190 t 40 39 38 37 36 35 34 + 226 t + 256 t + 290 t + 318 t + 353 t + 372 t + 394 t 33 32 31 30 29 28 27 + 405 t + 425 t + 431 t + 439 t + 438 t + 448 t + 448 t 26 25 24 23 22 21 20 + 448 t + 438 t + 439 t + 431 t + 425 t + 405 t + 394 t 19 18 17 16 15 14 13 + 372 t + 353 t + 318 t + 290 t + 256 t + 226 t + 190 t 12 11 10 9 8 7 6 5 + 158 t + 128 t + 101 t + 76 t + 54 t + 37 t + 25 t + 15 t 4 3 2 / 7 5 2 3 + 9 t + 4 t + 3 t + t + 1) / ((t - 1) (1 + t) (t + t + 1) / 2 2 (t - t + 1) 12 11 10 9 8 7 6 5 4 3 2 (t + t + t + t + t + t + t + t + t + t + t + t + 1) 12 11 10 9 8 7 6 5 4 3 2 (t - t + t - t + t - t + t - t + t - t + t - t + 1) 10 9 8 7 6 5 4 3 2 (t + t + t + t + t + t + t + t + t + t + 1) 6 5 4 3 2 (t + t + t + t + t + t + 1)) and in Maple notation -(t^54+t^53+3*t^52+4*t^51+9*t^50+15*t^49+25*t^48+37*t^47+54*t^46+76*t^45+101*t^ 44+128*t^43+158*t^42+190*t^41+226*t^40+256*t^39+290*t^38+318*t^37+353*t^36+372* t^35+394*t^34+405*t^33+425*t^32+431*t^31+439*t^30+438*t^29+448*t^28+448*t^27+ 448*t^26+438*t^25+439*t^24+431*t^23+425*t^22+405*t^21+394*t^20+372*t^19+353*t^ 18+318*t^17+290*t^16+256*t^15+226*t^14+190*t^13+158*t^12+128*t^11+101*t^10+76*t ^9+54*t^8+37*t^7+25*t^6+15*t^5+9*t^4+4*t^3+3*t^2+t+1)/(t-1)^7/(1+t)^5/(t^2+t+1) ^3/(t^2-t+1)^2/(t^12+t^11+t^10+t^9+t^8+t^7+t^6+t^5+t^4+t^3+t^2+t+1)/(t^12-t^11+ t^10-t^9+t^8-t^7+t^6-t^5+t^4-t^3+t^2-t+1)/(t^10+t^9+t^8+t^7+t^6+t^5+t^4+t^3+t^2 +t+1)/(t^6+t^5+t^4+t^3+t^2+t+1) For the sake of Sloane, here are the first 31 term, starting at n=0 1, 0, 4, 2, 12, 12, 34, 40, 85, 108, 190, 250, 394, 516, 762, 984, 1385, 1764, 2396, 2998, 3966, 4886, 6316, 7684, 9739, 11706, 14594, 17358, 21320, 25134, 30470 Furthermore, a(n) is a quasi-polynomial given as sum of, 8, quasi-polynomials 8 ----- \ a(n) = ) P[i](n) / ----- i = 1 where , P[1](n), P[2](n), P[3](n), P[4](n), P[5](n), P[6](n), P[7](n), P[8](n), are defined as followed P[1](n), is the polynomial 5821 6 5821 5 685621 4 104359 3 100232903 2 --------- n + -------- n + --------- n + ------- n + --------- n 311351040 12972960 124540416 2594592 622702080 7963693 1176641251 + -------- n + ---------- 25945920 2615348736 and in Maple notation 5821/311351040*n^6+5821/12972960*n^5+685621/124540416*n^4+104359/2594592*n^3+ 100232903/622702080*n^2+7963693/25945920*n+1176641251/2615348736 This is the leading term in particular, a(n) , is asymptotic to 6 5821 n --------- 311351040 P[2](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 2 31 4 31 3 1243 2 1745 331237 [- ------ n - ----- n - ----- n - ----- n - ------, 179712 11232 59904 22464 179712 31 4 31 3 1243 2 1745 331237 ------ n + ----- n + ----- n + ----- n + ------] 179712 11232 59904 22464 179712 and in Maple format [-31/179712*n^4-31/11232*n^3-1243/59904*n^2-1745/22464*n-331237/179712, 31/ 179712*n^4+31/11232*n^3+1243/59904*n^2+1745/22464*n+331237/179712] P[3](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 3 2 13 281 2 161 [-1/972 n - --- n - ----, 1/486 n + 4/243 n + ----, 972 5832 2916 2 41 -1/972 n - 1/324 n - ----] 5832 and in Maple format [-1/972*n^2-13/972*n-281/5832, 1/486*n^2+4/243*n+161/2916, -1/972*n^2-1/324*n-\ 41/5832] P[4](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 6 n -1 n 11 n n 11 [--- + 5/216, --, - --- - ---, - --- - 5/216, 1/36, --- + ---] 108 36 108 216 108 108 216 and in Maple format [1/108*n+5/216, -1/36, -1/108*n-11/216, -1/108*n-5/216, 1/36, 1/108*n+11/216] P[5](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 7 18 -24 32 -24 18 -10 -10 [--, ---, --, ---, --, ---, ---] 49 49 49 49 49 49 49 and in Maple format [18/49, -24/49, 32/49, -24/49, 18/49, -10/49, -10/49] P[6](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 11 -4 -12 12 -12 12 -12 -4 [2/11, 2/11, --, 8/11, ---, --, ---, --, ---, 8/11, --] 11 11 11 11 11 11 11 and in Maple format [2/11, 2/11, -4/11, 8/11, -12/11, 12/11, -12/11, 12/11, -12/11, 8/11, -4/11] P[7](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 13 -2 -2 -8 12 -15 15 -16 15 -15 12 -8 [6/13, --, --, 6/13, --, --, ---, --, ---, --, ---, --, --] 13 13 13 13 13 13 13 13 13 13 13 and in Maple format [6/13, -2/13, -2/13, 6/13, -8/13, 12/13, -15/13, 15/13, -16/13, 15/13, -15/13, 12/13, -8/13] P[8](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 26 -2 -2 [0, 2/13, --, 0, 2/13, 0, 1/13, 3/13, 4/13, 3/13, 1/13, 0, 2/13, 0, --, 2/13, 0, 13 13 -2 -1 -3 -4 -3 -1 -2 --, 0, --, --, --, --, --, 0, --] 13 13 13 13 13 13 13 and in Maple format [0, 2/13, -2/13, 0, 2/13, 0, 1/13, 3/13, 4/13, 3/13, 1/13, 0, 2/13, 0, -2/13, 2 /13, 0, -2/13, 0, -1/13, -3/13, -4/13, -3/13, -1/13, 0, -2/13] That makes it very easy to compute a(n) for large n. In particular, the numb\ er of ways of having, 100000000000000000000000000000000000000000000000000\ 00000000000000000000000000000000000000000000000000, coins in your two pocekts so that both pockets have the same amount is 1869593883482772371661260550149439038327927216816105704994593883482772371661260\ 5501494390383279272213031310253532475754697976920199142421364643586865809088031\ 3102535324757546979769201991424213646436436428797539908651019762130873241984353\ 0954642065753176864287975399086510197621308732419843530954646363924141701919479\ 6972574750352528130305908083685861463639241417019194796972574750352528130305908\ 1017544132821910599688377466155243933021710799488577266355044132821910599688377\ 4661552439330217107995247753069975292197514419736641958864181086403308625530847\ 7530699752921975144197366419588641810864035 ------------------------------------ This ends this article, that took, 0.954, seconds to generate.