2018年9月24日月曜日

180924

Ruby


Expansion of theta_4(q)^b in powers of q = exp(Pi i t)

-28 <= b <= 28 のとき、出力してみた。

def s(k, n)
  s = 0
  (1..n).each{|i| s += i if n % i == 0 && i % k == 0}
  s
end

def A(ary, n)
  a_ary = [1]
  a = [0] + (1..n).map{|i| ary.inject(0){|s, j| s + j[1] * s(j[0], i)}}
  (1..n).each{|i| a_ary << (1..i).inject(0){|s, j| s - a[j] * a_ary[-j]} / i}
  a_ary
end

def B(k, n)
  A([[1, 2 * k], [2, -k]], n)
end

n = 30
-28.upto(28){|i| p [i, B(i, n)]}

出力結果
[-28, [1, 56, 1624, 32480, 503384, 6440784, 70786912, 686577088, 5992951384, 47776150744, 351872947216, 2416267224224, 15585879310176, 95023751851280, 550435283089088, 3042813237891392, 16113562252291672, 82014156269030384, 402366072890195064, 1907630974993082976, 8759675533443400720, 39037020391980812032, 169139235544857978400, 713670307390583841088, 2936810077908914847584, 11802121500158402988232, 46374603353250996050640, 178369757578402864153792, 672246246931518841059008, 2484915984178103534196880, 9016744845844611900634176]]
[-27, [1, 54, 1512, 29232, 438426, 5434128, 57908592, 545068224, 4620803976, 35803129542, 256462219440, 1713894480720, 10765330699536, 63947544525648, 361091512399392, 1946775064587840, 10059106161975066, 49977067282246944, 239438535366014232, 1108983751942646160, 4976635875428376432, 21681666465886332576, 91869736859314615728, 379205997381661026240, 1526982728580144086832, 6006543158095582635270, 23108474796415113864528, 87047086759368793789760, 321376536699752714836032, 1164010214154363273949680, 4139584011254993416014240]]
[-26, [1, 52, 1404, 26208, 379964, 4557384, 47043360, 429309504, 3531544380, 26572389844, 184971777432, 1202060175264, 7346783287584, 42488488508808, 233709336918720, 1228019712933312, 6187085604062012, 29986740805740264, 140206512220063068, 633999718415412960, 2778783156078949656, 11828327318943542784, 48985153103300744928, 197683768984982424768, 778520112026791219488, 2995920915726349435708, 11279028000320937770328, 41588070287658945043136, 150334110692202191478464, 533260273927193240969736, 1857737169928348337109312]]
[-25, [1, 50, 1300, 23400, 327550, 3797560, 37931400, 335275200, 2673685300, 19518415850, 131921084360, 832975236600, 4949725973400, 27848065953400, 149102294341200, 763005065359680, 3745738886151550, 17697539511545200, 80700396137643100, 356042363457651000, 1523155486336657160, 6330719794839663600, 25608826512970854600, 100980994797396542400, 388707684336621491400, 1462524972192590737962, 5385096501963172463000, 19425101414366714573600, 68713742356194619528000, 238578336892906375242600, 813751021887384508347600]]
[-24, [1, 48, 1200, 20800, 280752, 3142560, 30338880, 259459200, 2003790000, 14178640368, 92960115360, 569803615680, 3289122824000, 17987650183200, 93669997008000, 466466351287680, 2229627536828592, 10261752523778400, 45603482666406000, 196167317470962240, 818560571243840160, 3319794001745088000, 13108732019510769600, 50475128294452003200, 189790479709718372160, 697763551670291610960, 2511228815788751774496, 8856709000908837916800, 30640242821306969961600, 104072855869625775599904, 347351879964113004548480]]
[-23, [1, 46, 1104, 18400, 239154, 2581152, 24056160, 198823040, 1485433104, 10177345486, 64663512288, 384402300960, 2153523131040, 11437761254432, 57880610587200, 280265903825280, 1303272560982834, 5838468742907712, 25267289255586864, 105893098920536480, 430684051768903008, 1703189786065601600, 6560315006113716960, 24649811550897290880, 90476411334607050720, 324817721027628666190, 1141898653168062765600, 3935110420094512791168, 13306013450852034554240, 44186260245185231023200, 144221986455775454452544]]
[-22, [1, 44, 1012, 16192, 202356, 2102936, 18896064, 150747520, 1088265332, 7211641580, 44356933544, 255472920256, 1387689358528, 7151069205016, 35134409940608, 165273439140480, 747047401948276, 3254796172584792, 13706092636257076, 55918922890025536, 221503630245672104, 853494312972511232, 3204447137019290944, 11740851975687401600, 42037595807513490624, 147268671405778493252, 505372164316874076200, 1700562203050475267712, 5616533651441428225664, 18223007440308403471640, 58129857007930202746240]]
[-21, [1, 42, 924, 14168, 169974, 1698312, 14692216, 112987776, 787175004, 5039316786, 29971442424, 167060546184, 878920016296, 4390113366408, 20920981191792, 95515527307648, 419275600889334, 1775001330567696, 7266754687687572, 28837195781957640, 111159368324081784, 416993869451825424, 1524856394246164728, 5443725278910484608, 18998568571928281336, 64898974336315921074, 217237206275724369000, 713272166693775242848, 2299372601885103305088, 7284034487278750667928, 22692879537590014608240]]
[-20, [1, 40, 840, 12320, 141640, 1358448, 11297440, 83631680, 561539400, 3468363400, 19922193200, 107343635040, 546373245600, 2642351627440, 12200693947200, 54007656632000, 230002160331080, 945228781171920, 3758583910304040, 14494657518341280, 54323193841192752, 198223377628161280, 705393384520540640, 2451645040245662400, 8333245721275210400, 27734986390239864152, 90485420448866605680, 289670671524893189440, 910767733007685471040, 2814864922224754129200, 8558451029687017346496]]
[-19, [1, 38, 760, 10640, 117002, 1075248, 8582224, 61061440, 394559320, 2348001494, 13008061200, 67666510320, 332809029680, 1556541579760, 6955832361824, 29820933412800, 123079426294922, 490508040685920, 1892520799129480, 7085465166635440, 25793668438185552, 91466354764345312, 316458512404166160, 1069823185020632640, 3538494014276085904, 11464481705561830550, 36424344019710001136, 113595603754517963200, 348063893178159296960, 1048690787886883501520, 3109295603781371154400]]
[-18, [1, 36, 684, 9120, 95724, 841320, 6433248, 43918272, 272670444, 1561033348, 8329222584, 41772509280, 198265106400, 895619289384, 3868763174208, 16044584545344, 64103055405804, 247461482137032, 925411686479820, 3360039419100960, 11868761624717880, 40859368353437184, 137307731407739424, 451063179002970432, 1450375340033484768, 4570180232381762508, 14127316643329422840, 42882777178873986368, 127935503432960309568, 375440380717895123112, 1084579797249158036160]]
[-17, [1, 34, 612, 7752, 77486, 649944, 4751976, 31070016, 185025348, 1017375098, 5220022312, 25201899288, 115265410488, 502210951832, 2094181357968, 8390590348992, 32410328691374, 121046064563376, 438223126488844, 1541288556805080, 5276805352500456, 17616371539745328, 57438026848112424, 183160057587181632, 571954416653229864, 1751020086032922426, 5261076735075547704, 15528419510393139104, 45063980072971299008, 128685998584726980552, 361871958100844427024]]
[-16, [1, 32, 544, 6528, 61984, 495040, 3453312, 21581568, 123040288, 648624288, 3194776000, 14823993472, 65231647104, 273714726080, 1100198199040, 4252621927680, 15859616674336, 57229459033664, 200317325329056, 681613044496256, 2258998492629440, 7304622434350080, 23080725609199744, 71362392703991040, 216171131373220224, 642279177183320800, 1873670535016845504, 5371709759567226624, 15147967538908675840, 42049526004566975168, 114986885846823486720]]
[-15, [1, 30, 480, 5440, 48930, 371136, 2464320, 14688000, 80001120, 403533790, 1904433984, 8477603520, 35829727680, 144548556480, 559157308800, 2081866609920, 7484792950050, 26057409056640, 88057506412320, 289477248154560, 927461989122624, 2900953904854400, 8871567968612160, 26561967221349120, 77955837952722240, 224514441369480414, 635159179340088000, 1766692869938845440, 4835527186894951680, 13033631831560334400, 34620567863249935232]]
[-14, [1, 28, 420, 4480, 38052, 273336, 1723008, 9770240, 50722980, 244273820, 1102294984, 4698110592, 19034512000, 73696070840, 273868321536, 980502270720, 3392689809572, 11376760267320, 37060195850020, 117522159692672, 363460123604424, 1098073086009344, 3245486079543680, 9396667495192320, 26682663915051648, 74389704494912212, 203821321529106120, 549322347643749120, 1457474240085840640, 3809751705628161720, 9817821769313608960]]
[-13, [1, 26, 364, 3640, 29094, 197288, 1177176, 6333184, 31258604, 143374530, 617193304, 2513060264, 9739727816, 36115518376, 128680223152, 442158402816, 1469734751654, 4738671343952, 14853923411652, 45360567953064, 135191787693144, 393868290857808, 1123312910529368, 3140191938387712, 8614288268780376, 23213737945756098, 61510133382424328, 160398928580441824, 411959866378075392, 1042855861591161592, 2603765402679575472]]
[-12, [1, 24, 312, 2912, 21816, 139152, 783328, 3986112, 18650424, 81251896, 332798544, 1291339296, 4776117216, 16922753616, 57683178432, 189821722688, 604884735288, 1871370360240, 5633654421720, 16535803556064, 47405095227984, 132942579098368, 365211946954656, 984029905455168, 2603403713102816, 6769958807156712, 17319807203669520, 43629342871665088, 108299884098294720, 265093293382115280, 640286467040437056]]
[-11, [1, 22, 264, 2288, 15994, 95568, 505648, 2425280, 10721832, 44229350, 171861360, 633713808, 2230733648, 7532979344, 24502989984, 77036477760, 234785552122, 695409096096, 2006117554936, 5647472566736, 15540674951472, 41865577406752, 110560253660784, 286562260273344, 729774486503920, 1827826932181030, 4506571408141968, 10946523549070912, 26214943726286656, 61938666454846896, 144473724891427360]]
[-10, [1, 20, 220, 1760, 11420, 63624, 315040, 1418560, 5903260, 22976820, 84413912, 294841120, 984745120, 3159938760, 9780562880, 29296914112, 85169213340, 240882506920, 664216884540, 1788966694240, 4714033526616, 12170584419840, 30826269009760, 76687696955840, 187577264348320, 451539631341148, 1070647576631960, 2502494285650880, 5770155117481920, 13133366582659400, 29525852648992832]]
[-9, [1, 18, 180, 1320, 7902, 40824, 188232, 792000, 3088980, 11297546, 39090312, 128849976, 406865880, 1236379320, 3629385936, 10324840512, 28542038238, 76852151280, 201967043260, 518957929080, 1305848905416, 3222313017456, 7807214691720, 18593534036160, 43571355468168, 100555979011146, 228739255783128, 513246682211360, 1136745110975040, 2486713863179304, 5376093029096784]]
[-8, [1, 16, 144, 960, 5264, 25056, 106944, 418176, 1520784, 5201232, 16871648, 52252992, 155341248, 445226848, 1234726272, 3323392128, 8704504976, 22234655520, 55498917840, 135595345600, 324759439584, 763505859072, 1764050361152, 4009763323008, 8975341703616, 19800832628336, 43088101022304, 92551562330496, 196357355359616, 411726374183520, 853706446959744]]
[-7, [1, 14, 112, 672, 3346, 14560, 57120, 206208, 694960, 2209774, 6683040, 19345760, 53874912, 144936288, 377965760, 958231680, 2367566866, 5713057728, 13488657168, 31210552800, 70873262880, 158145658560, 347146238880, 750384675712, 1598690194080, 3359762331758, 6970100920160, 14283993601920, 28934034095232, 57964700284960, 114905358321600]]
[-6, [1, 12, 84, 448, 2004, 7896, 28224, 93312, 289236, 848972, 2377704, 6391872, 16571968, 41599320, 101430144, 240877440, 558440916, 1266406680, 2814053908, 6136337088, 13148606184, 27717527552, 57542477760, 117757784448, 237752294976, 473942546532, 933455985000, 1817622489984, 3501113922432, 6674700098136, 12600624177280]]
[-5, [1, 10, 60, 280, 1110, 3912, 12600, 37760, 106620, 286290, 736184, 1822920, 4365800, 10149320, 22971120, 50744448, 109643350, 232145040, 482403060, 985229640, 1980034104, 3920000400, 7652388280, 14742829440, 28052762040, 52757827794, 98127789480, 180610764640, 329134001280, 594143328600, 1062903740400]]
[-4, [1, 8, 40, 160, 552, 1712, 4896, 13120, 33320, 80872, 188784, 425952, 932640, 1988080, 4137024, 8422848, 16810536, 32943760, 63482760, 120440608, 225217904, 415498496, 756920160, 1362645440, 2425895712, 4273590392, 7454092720, 12879684160, 22056267840, 37451209840, 63078595776]]
[-3, [1, 6, 24, 80, 234, 624, 1552, 3648, 8184, 17654, 36816, 74544, 147056, 283440, 535008, 990912, 1803882, 3232224, 5707624, 9943536, 17106960, 29088352, 48922320, 81438528, 134261584, 219336630, 355242288, 570675904, 909674688, 1439394192, 2261635168]]
[-2, [1, 4, 12, 32, 76, 168, 352, 704, 1356, 2532, 4600, 8160, 14176, 24168, 40512, 66880, 108876, 174984, 277932, 436640, 679032, 1046016, 1597088, 2418240, 3632992, 5417708, 8022840, 11802176, 17252928, 25070568, 36223424]]
[-1, [1, 2, 4, 8, 14, 24, 40, 64, 100, 154, 232, 344, 504, 728, 1040, 1472, 2062, 2864, 3948, 5400, 7336, 9904, 13288, 17728, 23528, 31066, 40824, 53408, 69568, 90248, 116624]]
[0, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
[1, [1, -2, 0, 0, 2, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0]]
[2, [1, -4, 4, 0, 4, -8, 0, 0, 4, -4, 8, 0, 0, -8, 0, 0, 4, -8, 4, 0, 8, 0, 0, 0, 0, -12, 8, 0, 0, -8, 0]]
[3, [1, -6, 12, -8, 6, -24, 24, 0, 12, -30, 24, -24, 8, -24, 48, 0, 6, -48, 36, -24, 24, -48, 24, 0, 24, -30, 72, -32, 0, -72, 48]]
[4, [1, -8, 24, -32, 24, -48, 96, -64, 24, -104, 144, -96, 96, -112, 192, -192, 24, -144, 312, -160, 144, -256, 288, -192, 96, -248, 336, -320, 192, -240, 576]]
[5, [1, -10, 40, -80, 90, -112, 240, -320, 200, -250, 560, -560, 400, -560, 800, -960, 730, -480, 1240, -1520, 752, -1120, 1840, -1600, 1200, -1210, 2000, -2240, 1600, -1680, 2720]]
[6, [1, -12, 60, -160, 252, -312, 544, -960, 1020, -876, 1560, -2400, 2080, -2040, 3264, -4160, 4092, -3480, 4380, -7200, 6552, -4608, 8160, -10560, 8224, -7812, 10200, -13120, 12480, -10104, 14144]]
[7, [1, -14, 84, -280, 574, -840, 1288, -2368, 3444, -3542, 4424, -7560, 9240, -8456, 11088, -16576, 18494, -17808, 19740, -27720, 34440, -29456, 31304, -49728, 52808, -43414, 52248, -68320, 74048, -68376, 71120]]
[8, [1, -16, 112, -448, 1136, -2016, 3136, -5504, 9328, -12112, 14112, -21312, 31808, -35168, 38528, -56448, 74864, -78624, 84784, -109760, 143136, -154112, 149184, -194688, 261184, -252016, 246176, -327040, 390784, -390240, 395136]]
[9, [1, -18, 144, -672, 2034, -4320, 7392, -12672, 22608, -34802, 44640, -60768, 93984, -125280, 141120, -182400, 262386, -317376, 343536, -421344, 557280, -665280, 703584, -800640, 1068384, -1256562, 1234080, -1421184, 1851264, -2034720, 2057280]]
[10, [1, -20, 180, -960, 3380, -8424, 16320, -28800, 52020, -88660, 129064, -175680, 262080, -386920, 489600, -600960, 840500, -1137960, 1330420, -1563840, 2050344, -2611200, 2986560, -3358080, 4194240, -5318268, 5878440, -6299520, 7862400, -9619560, 10216320]]
[11, [1, -22, 220, -1320, 5302, -15224, 33528, -63360, 116380, -209550, 339064, -491768, 719400, -1095160, 1538416, -1964160, 2624182, -3696880, 4763220, -5686648, 7217144, -9528816, 11676280, -13495680, 16317048, -20787470, 25022184, -27785120, 32503680, -40862184, 47430768]]
[12, [1, -24, 264, -1760, 7944, -25872, 64416, -133056, 253704, -472760, 825264, -1297056, 1938336, -2963664, 4437312, -6091584, 8118024, -11368368, 15653352, -19822176, 24832944, -32826112, 42517728, -51425088, 61903776, -78146664, 98021616, -115331264, 133522752, -164079696, 201364416]]
[13, [1, -26, 312, -2288, 11466, -41808, 116688, -265408, 535704, -1031914, 1899664, -3214224, 5043376, -7801744, 12066912, -17689152, 24443978, -34039200, 48210760, -64966096, 83323344, -109157152, 145532816, -185245632, 227110416, -284788010, 363737712, -448126016, 531517376, -643027632, 800145632]]
[14, [1, -28, 364, -2912, 16044, -64792, 200928, -503360, 1089452, -2186940, 4196920, -7544992, 12547808, -19975256, 31553344, -48484800, 70439852, -99602104, 142487436, -200569824, 268594872, -354052608, 476105504, -630908096, 800698080, -1008274932, 1296257144, -1648943296, 2022013760, -2457911512, 3056208064]]
[15, [1, -30, 420, -3640, 21870, -96936, 331240, -911040, 2128260, -4495430, 8972712, -16946280, 29822520, -49476840, 80027280, -127083328, 193511790, -282611280, 409172940, -590913960, 825736296, -1115671760, 1509537960, -2048372160, 2698852520, -3463029894, 4472616120, -5803339360, 7347537600, -9095661240, 11335886864]]
[16, [1, -32, 480, -4480, 29152, -140736, 525952, -1580800, 3994080, -8945824, 18626112, -36714624, 67978880, -118156480, 197120256, -321692928, 509145568, -772845120, 1143441760, -1681379200, 2428524096, -3392205824, 4658843520, -6411152640, 8705492608, -11488092896, 15000919872, -19697555200, 25593401600, -32467266240, 40864033536]]
[17, [1, -34, 544, -5440, 38114, -199104, 808384, -2641664, 7213984, -17215458, 37569728, -77129408, 149405248, -272064192, 470966912, -790414592, 1291650786, -2035437440, 3101265120, -4648909760, 6883061184, -9931183488, 13967503552, -19489000192, 27036220096, -36719672546, 48877735232, -64882013952, 85898222336, -111723674688, 142979339392]]
[18, [1, -36, 612, -6528, 48996, -275400, 1207680, -4269312, 12573540, -32041636, 73617480, -157553280, 318102912, -605381832, 1090632960, -1888224000, 3176573796, -5177295432, 8148505828, -12507419520, 18918517320, -28067389440, 40578145920, -57669043968, 81375600000, -113272212204, 154398101832, -207972274944, 279331331328, -371269791432, 484986858240]]
[19, [1, -38, 684, -7752, 62054, -373464, 1759704, -6697728, 21210156, -57739518, 140116184, -313328088, 658369608, -1305768920, 2449182384, -4387011840, 7597766246, -12766353840, 20748447108, -32728127192, 50601708504, -76895771568, 114223115480, -166029979392, 238352317656, -338575421950, 472600643976, -648718685984, 883678139136, -1195524774792, 1594639240368]]
[20, [1, -40, 760, -9120, 77560, -497648, 2508000, -10232640, 34729720, -100906760, 259114704, -606957280, 1327461600, -2738111280, 5341699520, -9915552192, 17701924600, -30615844560, 51294999960, -83279292960, 131880275664, -204949382400, 312126610080, -464844224960, 680432137440, -984382611928, 1404010658960, -1968103484480, 2724593155520, -3743846975920, 5089580732736]]
[21, [1, -42, 840, -10640, 95802, -652848, 3504816, -15266880, 55350120, -171361498, 465944304, -1145653488, 2610853840, -5595003120, 11337146784, -21817881792, 40208417466, -71565375840, 123411903160, -206218644912, 335056780464, -532597541344, 830096613360, -1266359895360, 1893781702512, -2790751314330, 4058779021584, -5809617168320, 8190877926720, -11431035439824, 15805879161632]]
[22, [1, -44, 924, -12320, 117084, -844536, 4812192, -22297792, 86075484, -283367436, 815677016, -2108077536, 5012882336, -11159625400, 23460347328, -46790491968, 89096422492, -163282917336, 289559673084, -497610124704, 830202403800, -1351064867328, 2153312518240, -3361695239232, 5140361517984, -7724269359972, 11444537517336, -16709010117184, 24015334687168, -34075597680696, 47873378766400]]
[23, [1, -46, 1012, -14168, 141726, -1078792, 6503112, -31946816, 130905236, -457207478, 1392036360, -3784029000, 9401213016, -21752359112, 47412641232, -97936966080, 192747766686, -363967164176, 663612939132, -1171941833480, 2007831887432, -3348062963344, 5456890474248, -8710505815360, 13617909938952, -20885881710454, 31527898462552, -46904811133408, 68719323996224, -99237530067544, 141662701280848]]
[24, [1, -48, 1104, -16192, 170064, -1362336, 8662720, -44981376, 195082320, -721175536, 2319457632, -6631997376, 17231109824, -41469483552, 93703589760, -200343312768, 407488018512, -793229226336, 1487286966928, -2697825744960, 4744779429216, -8110465650176, 13523760003648, -22063059606912, 35250721087168, -55204237463376, 84944161233120, -128716413627520, 192127452262272, -282507110257440, 409984511707776]]
[25, [1, -50, 1200, -18400, 202450, -1702560, 11389600, -62339200, 285385200, -1114064850, 3779134240, -11360877600, 30885301600, -77374394400, 181284196800, -401031812480, 842726826450, -1691534395200, 3262594952400, -6077725252000, 10968671291040, -19220947905600, 32802221530400, -54693728246400, 89267475949600, -142743029326162, 223991253535200, -345718693238400, 525491835433600, -786742987874400, 1161295395893440]]
[26, [1, -52, 1300, -20800, 239252, -2107560, 14797120, -85155200, 410468500, -1688240372, 6030043240, -19043826880, 54177864000, -141373532200, 343594659200, -786344740480, 1706685733012, -3532307607400, 7010460268500, -13412537087040, 24832297608040, -44603133286400, 77924078814400, -132816314883200, 221394909419840, -361407558819164, 578472382307304, -909636568464000, 1407681394953600, -2145304809169704, 3221568346322560]]
[27, [1, -54, 1404, -23400, 280854, -2586168, 19014840, -114791040, 581257404, -2513392494, 9436118328, -31274226360, 93086496360, -253106219448, 638406025200, -1511651306880, 3387901252374, -7229247074928, 14765641285044, -29018207233080, 55108831380408, -101440703660400, 181434042582840, -316176906314880, 538265644820280, -896820392178414, 1464212332875816, -2346272971038368, 3696677780664960, -5733430059474216, 8759016189382896]]
[28, [1, -56, 1512, -26208, 327656, -3147984, 24189984, -152867520, 811401192, -3681079640, 14500933104, -50376047904, 156797510688, -444306558864, 1163495873088, -2851049839680, 6597606440936, -14512424533488, 30505974273096, -61591664700384, 119983597365744, -226303038736128, 414352982942304, -738358447579200, 1283861585339424, -2183013918429512, 3635198568784944, -5936645280445376, 9523977599887936, -15031150280922384, 23358459198626496]]

0 件のコメント:

コメントを投稿

注: コメントを投稿できるのは、このブログのメンバーだけです。