The Number of Ways of Having n Coins in Your Two pockets, with denominatio\ ns in the set, {1, 5, 10, 25, 50}, 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, 50}, in such a way that both pockets carry the same amount , then infinity ----- \ n 104 102 101 100 99 98 ) a(n) t = - (t + 3 t + 3 t + 8 t + 15 t + 28 t / ----- n = 0 97 96 95 94 93 92 91 + 43 t + 71 t + 105 t + 152 t + 212 t + 284 t + 372 t 90 89 88 87 86 85 84 + 480 t + 598 t + 732 t + 884 t + 1047 t + 1217 t + 1403 t 83 82 81 80 79 78 + 1592 t + 1789 t + 1992 t + 2195 t + 2399 t + 2613 t 77 76 75 74 73 72 + 2817 t + 3021 t + 3233 t + 3438 t + 3633 t + 3834 t 71 70 69 68 67 66 + 4025 t + 4207 t + 4383 t + 4542 t + 4688 t + 4834 t 65 64 63 62 61 60 + 4950 t + 5048 t + 5142 t + 5220 t + 5272 t + 5323 t 59 58 57 56 55 54 + 5355 t + 5379 t + 5402 t + 5413 t + 5412 t + 5425 t 53 52 51 50 49 48 + 5426 t + 5422 t + 5426 t + 5425 t + 5412 t + 5413 t 47 46 45 44 43 42 + 5402 t + 5379 t + 5355 t + 5323 t + 5272 t + 5220 t 41 40 39 38 37 36 + 5142 t + 5048 t + 4950 t + 4834 t + 4688 t + 4542 t 35 34 33 32 31 30 + 4383 t + 4207 t + 4025 t + 3834 t + 3633 t + 3438 t 29 28 27 26 25 24 + 3233 t + 3021 t + 2817 t + 2613 t + 2399 t + 2195 t 23 22 21 20 19 18 + 1992 t + 1789 t + 1592 t + 1403 t + 1217 t + 1047 t 17 16 15 14 13 12 11 + 884 t + 732 t + 598 t + 480 t + 372 t + 284 t + 212 t 10 9 8 7 6 5 4 3 2 + 152 t + 105 t + 71 t + 43 t + 28 t + 15 t + 8 t + 3 t + 3 t / 16 15 14 13 12 11 10 9 8 7 6 + 1) / ((t + t + t + t + t + t + t + t + t + t + t / 5 4 3 2 32 31 29 28 26 25 23 + t + t + t + t + t + 1) (t - t + t - t + t - t + t 22 20 19 17 16 15 13 12 10 9 7 6 4 - t + t - t + t - t + t - t + t - t + t - t + t - t 3 10 9 8 7 6 5 4 3 2 + t - t + 1) (t + t + t + t + t + t + t + t + t + t + 1) 9 2 4 (t - 1) (t + t + 1) 12 11 10 9 8 7 6 5 4 3 2 5 (t + t + t + t + t + t + t + t + t + t + t + t + 1) (1 + t) 12 11 10 9 8 7 6 5 4 3 2 (t - t + t - t + t - t + t - t + t - t + t - t + 1) 2 2 6 5 4 3 2 (t - t + 1) (t + t + t + t + t + t + 1)) and in Maple notation -(t^104+3*t^102+3*t^101+8*t^100+15*t^99+28*t^98+43*t^97+71*t^96+105*t^95+152*t^ 94+212*t^93+284*t^92+372*t^91+480*t^90+598*t^89+732*t^88+884*t^87+1047*t^86+ 1217*t^85+1403*t^84+1592*t^83+1789*t^82+1992*t^81+2195*t^80+2399*t^79+2613*t^78 +2817*t^77+3021*t^76+3233*t^75+3438*t^74+3633*t^73+3834*t^72+4025*t^71+4207*t^ 70+4383*t^69+4542*t^68+4688*t^67+4834*t^66+4950*t^65+5048*t^64+5142*t^63+5220*t ^62+5272*t^61+5323*t^60+5355*t^59+5379*t^58+5402*t^57+5413*t^56+5412*t^55+5425* t^54+5426*t^53+5422*t^52+5426*t^51+5425*t^50+5412*t^49+5413*t^48+5402*t^47+5379 *t^46+5355*t^45+5323*t^44+5272*t^43+5220*t^42+5142*t^41+5048*t^40+4950*t^39+ 4834*t^38+4688*t^37+4542*t^36+4383*t^35+4207*t^34+4025*t^33+3834*t^32+3633*t^31 +3438*t^30+3233*t^29+3021*t^28+2817*t^27+2613*t^26+2399*t^25+2195*t^24+1992*t^ 23+1789*t^22+1592*t^21+1403*t^20+1217*t^19+1047*t^18+884*t^17+732*t^16+598*t^15 +480*t^14+372*t^13+284*t^12+212*t^11+152*t^10+105*t^9+71*t^8+43*t^7+28*t^6+15*t ^5+8*t^4+3*t^3+3*t^2+1)/(t^16+t^15+t^14+t^13+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^32-t^31+t^29-t^28+t^26-t^25+t^23-t^22+t^20-t^19+t^17-t^16+ t^15-t^13+t^12-t^10+t^9-t^7+t^6-t^4+t^3-t+1)/(t^10+t^9+t^8+t^7+t^6+t^5+t^4+t^3+ t^2+t+1)/(t-1)^9/(t^2+t+1)^4/(t^12+t^11+t^10+t^9+t^8+t^7+t^6+t^5+t^4+t^3+t^2+t+ 1)/(1+t)^5/(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^2-t+1)^2/(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, 5, 4, 17, 26, 63, 100, 204, 322, 568, 890, 1438, 2172, 3332, 4862, 7129, 10130, 14331, 19826, 27301, 36888, 49585, 65706, 86508, 112590, 145696, 186608, 237740, 300318, 377332 Furthermore, a(n) is a quasi-polynomial given as sum of, 10, quasi-polynomials 10 ----- \ 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), P[9](n), P[10](n), are defined as followed P[1](n), is the polynomial 138371 8 138371 7 11796167 6 4877617 5 ------------ n + ----------- n + ----------- n + ---------- n 889218570240 22230464256 95273418240 3175780608 507939529 4 1077548761 3 250054655797 2 1550505703 + ----------- n + ----------- n + ------------- n + ---------- n 42343741440 19054683648 1333827855360 2722097664 2880709584007 + ------------- 3201186852864 and in Maple notation 138371/889218570240*n^8+138371/22230464256*n^7+11796167/95273418240*n^6+4877617 /3175780608*n^5+507939529/42343741440*n^4+1077548761/19054683648*n^3+ 250054655797/1333827855360*n^2+1550505703/2722097664*n+2880709584007/ 3201186852864 This is the leading term in particular, a(n) , is asymptotic to 8 138371 n ------------ 889218570240 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 155 3 4255 2 56075 4190915 [- ------ n - ------ n - ------ n - ------ n - -------, 718848 179712 119808 179712 479232 31 4 155 3 4255 2 56075 4190915 ------ n + ------ n + ------ n + ------ n + -------] 718848 179712 119808 179712 479232 and in Maple format [-31/718848*n^4-155/179712*n^3-4255/119808*n^2-56075/179712*n-4190915/479232, 31/718848*n^4+155/179712*n^3+4255/119808*n^2+56075/179712*n+4190915/479232] P[3](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 3 169 2 1690 16525 61 3 1253 2 21157 9265 [- ----- n - ----- n - ------, ------ n + ------ n + ------ n + -----, 37179 37179 223074 148716 148716 297432 52488 61 3 577 2 7637 91405 - ------ n - ------ n - ------ n - ------] 148716 148716 297432 892296 and in Maple format [-169/37179*n^2-1690/37179*n-16525/223074, 61/148716*n^3+1253/148716*n^2+21157/ 297432*n+9265/52488, -61/148716*n^3-577/148716*n^2-7637/297432*n-91405/892296] 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 n -5 n n [5/54, - --- + 5/216, - --- - 5/72, --, --- - 5/216, --- + 5/72] 216 216 54 216 216 and in Maple format [5/54, -1/216*n+5/216, -1/216*n-5/72, -5/54, 1/216*n-5/216, 1/216*n+5/72] P[5](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 7 10 -8 10 -6 -6 [--, --, --, --, 0, 0, --] 49 49 49 49 49 and in Maple format [10/49, -8/49, 10/49, -6/49, 0, 0, -6/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 -2 -4 -4 -2 [--, 2/11, 0, 2/11, --, 4/11, --, 2/11, 0, 2/11, --] 11 11 11 11 and in Maple format [-2/11, 2/11, 0, 2/11, -4/11, 4/11, -4/11, 2/11, 0, 2/11, -2/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 -1 -3 -5 -5 -3 -1 [1/13, 1/13, --, 3/13, --, 3/13, --, 4/13, --, 3/13, --, 3/13, --] 13 13 13 13 13 13 and in Maple format [1/13, 1/13, -1/13, 3/13, -3/13, 3/13, -5/13, 4/13, -5/13, 3/13, -3/13, 3/13, -\ 1/13] P[8](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 17 -10 -14 -10 16 -10 -14 [2/17, 0, 2/51, 2/51, 0, 2/17, ---, 2/17, ---, 4/17, ---, --, ---, 4/17, ---, 51 51 51 51 51 51 -10 2/17, ---] 51 and in Maple format [2/17, 0, 2/51, 2/51, 0, 2/17, -10/51, 2/17, -14/51, 4/17, -10/51, 16/51, -10/ 51, 4/17, -14/51, 2/17, -10/51] P[9](n), is defined by the following list whose i-th entry is the expression \ if n is congruent to i mod, 26 -3 11 11 16 11 11 -3 -3 [--, 3/13, 3/13, 5/13, --, 9/13, --, --, --, 9/13, --, 5/13, 3/13, 3/13, --, --, 13 13 13 13 13 13 13 13 -5 -11 -9 -11 -16 -11 -9 -11 -5 -3 --, ---, --, ---, ---, ---, --, ---, --, --] 13 13 13 13 13 13 13 13 13 13 and in Maple format [-3/13, 3/13, 3/13, 5/13, 11/13, 9/13, 11/13, 16/13, 11/13, 9/13, 11/13, 5/13, 3/13, 3/13, -3/13, -3/13, -5/13, -11/13, -9/13, -11/13, -16/13, -11/13, -9/13, -11/13, -5/13, -3/13] P[10](n), is defined by the following list whose i-th entry is the expression\ if n is congruent to i mod, 51 126 -148 -458 -148 262 -130 218 -106 178 -214 148 -36 140 [---, ----, 20/3, ----, 6, ----, ---, ----, ---, ----, ---, ----, ---, ---, ---, 17 17 51 17 51 17 51 17 51 51 51 17 51 -2 22 46 118 118 46 22 -2 140 -36 148 -214 178 -106 --, 8/3, --, --, ---, ---, --, --, 8/3, --, ---, ---, ---, ----, ---, ----, 17 17 17 51 51 17 17 17 51 17 51 51 51 17 218 -130 262 -148 -458 -148 126 -398 132 -358 142 -326 ---, ----, ---, ----, 6, ----, 20/3, ----, ---, ----, ---, ----, ---, ----, 51 17 51 17 51 17 17 51 17 51 17 51 428 -326 142 -358 132 -398 ---, ----, ---, ----, ---, ----] 51 51 17 51 17 51 and in Maple format [126/17, -148/17, 20/3, -458/51, 6, -148/17, 262/51, -130/17, 218/51, -106/17, 178/51, -214/51, 148/51, -36/17, 140/51, -2/17, 8/3, 22/17, 46/17, 118/51, 118/ 51, 46/17, 22/17, 8/3, -2/17, 140/51, -36/17, 148/51, -214/51, 178/51, -106/17, 218/51, -130/17, 262/51, -148/17, 6, -458/51, 20/3, -148/17, 126/17, -398/51, 132/17, -358/51, 142/17, -326/51, 428/51, -326/51, 142/17, -358/51, 132/17, -\ 398/51] 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 1556096606964176214098405197066883963864978493051944654808022377272299463398125\ 0850220660366941101519373955084350353569152199715536161225548091405545498293708\ 6889779077765383398747855641724300298842464461650272548705996159051455244006338\ 5182173438216596220538538206346070232365491209769661891251283101402120653339659\ 4606263659069966778235270817488889903040748564143107145493285134326736152651704\ 1778390101592067563641378352447965478362822485656804569554854854159761307805710\ 7520744827519389195917398030544006526992313899669434475949674621736038895495270\ 6379202903738643960658692477345864626702909777410131894518241649686820347677283\ 0440223323302480891442401972539953658326933562953897013446759354631983108744183\ 5444740310390274079453454907340165146991581268995938567470884101239947282067833\ 9923 ------------------------------------ This ends this article, that took, 9.524, seconds to generate.