#OK to post #Soham Palande, Assignment 17, 11/08/2020 #PART 1 #Find the generating function of the number of kings tours on a 3 x n board using KingsToursGF and then find the coefficient of t^50. F:=KingToursGF(3,52,t) F := 2*t^2*(3*t^4+4*t^3+2*t^2-2)/(6*t^4+8*t^3+15*t^2+4*t-1) coeff(taylor(F,t=0,52),t,50) 3145849036836987795351683029577878807030 #PART 2 s:=SeqGW({[1,0],[0,1],[1,1],[1,2],[2,1]},35) s := [2, 8, 37, 187, 1005, 5633, 32566, 192792, 1162918, 7121902, 44165560, 276783968, 1750207940, 11153013440, 71550898197, 461746445731, 2995462031745, 19523143468973, 127777132138891, 839452832023207, 5533837097342891, 36594085887854795, 242680221398481381, 1613598426851118817, 10754859380597438069, 71842748551816723277, 480905190308830819225, 3225307676284611819217, 21670117616522081549953, 145840679672699944094433, 983053428271497814915238, 6636125814739273692660888, 44859345005089675067344174, 303638741080314921979131686, 2057763386337603966845020668] ope:=Findrec(s,n,N,5) ope := -2*(2*n+3)/(n+5)-(11*n+23)*N/(n+5)-(13*n+41)*N^2/(n+5)-5*(n+3)*N^3/(n+5)+N^4 Ini:=[2, 8, 37, 187] Ini := [2, 8, 37, 187] SeqFromRec(ope,n,N,Ini,3000)[3000] 95169091361304497661016734197678134770349822930308569276916914467565347871540683291808752282824707570651985872820372363152563131551499362536825304711559361666563103386330829999710178259606336618359856705840905896307823039694186915923739801088785552537207794661641719063082723104319582945468736368770654686751378287041101572685985713084393957598627298986861938927166053927103431921104126027579703091359302890708953724730599070838409654723308763002613165079306548111632722909218562889533100675786353470112016022196477554880490589499289089162582632715079250461763612854611196880347954440249628671174622179674903282050871247325146410790010719334253540172397663997792921830518354359522669329363082614972729965686428855219511297199827548476675004412199720715365099792501311123143368483881397876775712439421054798831717981977936622337062303624546576898187959341646575490702549296915200857634048143923818701102393144599106994024665053648913638391157955194662231996921003344586526221812096107389514125990119451880185515845934698037055104486896573666844857573880742852639391722910231692794433520126339340352663869698430014805776170895308465157999383126154136534892638175457579256315002808693778321645459807540062485196275478961352224073937381392596094278147716000344452101216213718218846995422403246683326563202994807095282839244324106363086847480478463730345215985413064515655006280716371594297868314185041474747026816679035293127055797403755491278529530018110422188400807126145601136460544996907253108026710738133221241693706980842171873604900269856459541793234702167937163679886476596787643003424261664266808615823066346661804622908642236679528725542671747404314012249795021732170691008575336656050986306648593100164229972842611760785390415331373519508784472911981975537222743422312589751576257948909815276363791495173342977855094118355700016556226919615428250897733703209967582718607928464069524222159738340806195626241390924709235357374015016254839959209084054394569432471432576684522506998779788376200443126782132255047582891261666245361634285199523372050333572627938881441014457739772722775254541205569963083330946306737155223437987340685548656285567503838100825537658312256841838804244651258118811651131924827871017999511708744102921789247462817980894438730298698541980861879749020341945718568693083738317799328488585909649259726166330681988951268751122991503360075439622584181083778123619416313964846558075294830227299727374990124401764015434769152111199549890678059731046462531157554362228562028418125254044367001279506736510680059995930940034 #PART 3 s:=SeqGW({[1,0,0],[0,1,0],[0,0,1],[1,1,1]},35) s := [2, 10, 88, 1043, 14778, 236001, 4107925, 76314975, 1491934038, 30389576308, 640286048416, 13877540824735, 308102204007536, 6983346070924707, 161156356282624227, 3778249609096250059, 89826197363219012470, 2162338803354415120414, 52637415804379149938876, 1294313658632145337351381, 32118082448138745067175242, 803656789698224684452667975, 20262539635339176715000960941, 514456553505357928725536149803, 13146084523635788235064716197728, 337929024350121818044901686404816, 8734691492940974137071498064995420, 226931194428057541769204674879130191, 5923987397778903817189358328568041496, 155335609958542073698381974113868127891, 4090172312867860136825480052716884724147, 108121976818168155620957000319917917053675, 2868707794254575240567639311917494731749030, 76377538885644568975349924729052848698617526, 2040172740682907191699950846063214773112927416] ope:=Findrec(s,n,N,6) ope := -(n-1)*(n-3)*(3*n+8)/((3*n+5)*(n+5)*(n+4))+(n+3)*(9*n^2-3*n-16)*N/((3*n+5)*(n+5)*(n+4))-2*(3*n+7)*(15*n^2+65*n+62)*N^2/((3*n+5)*(n+5)*(n+4))+N^3 Ini:=[2, 10, 88] Ini := [2, 10, 88] SeqFromRec(ope,n,N,Ini,3000)[3000] 1055961597172638192205714533827955182069330710185887123715638338751912356623868934358954829265893265497184019516455497946501358614406592180916562995571435822638011864699948413518735379729837425167828197932773091617214603560704076763403058008870590210530506834889187670236069663000563403909291518139471141193933668569097230791592378327765453206880338367141465884774689273332974613327790670133864770839786907616252716172612810392322684357026318977543761631185892041752872792707472523339315464878092600122776510487117547611700101814824458512731561188677556925181977017823995965449343853533549328389007002003812727585993220294254740294866113923151479672429490481644088528411109634826771309376893827003349243068183476873533935594331988585675337762038394870883132602159173883922347999944078821728163370937052619155590568391069063317592509955598788483466418234408407388202299036233322379192615075021698393212868787733569268229184628289565589549741584574327892919908881010751517221722381012834556556824848577221227684137830816101020327876526681725444453682864636555747673248741474708131366459673977930419195224272687150280798146593067544755578201466060570093254935347120068461604351415848203621522648676607169207523056123186434484713066312780810175397901692245443312244602960976968454897460424230265560584944905249327347768975517831568652679595607920084575082584347314212810007985240690964634053969181170611215275387792197501045392327155456594027530404389193373166529959026406585893677752993907919001817631111686530612365744087948657981705511840245825626621270255357615436919191022104201504251202188647227781935143967146969540653262038857149021960306229530963054026491708200678862903006329234012195611754127295080517138419193838585920213543419469950079348946755215094694137847178186210286204470627994554250221170678469119109643939053546724329890548255475005106738694859949241621137720195040487766275618591781040165985869235563695957345264145252201054929162788252799455694036338904769031986390960043941243280986491172713827805499916660157385659508981509849147715973547457229029295526584351410281813731593170470817309110789876049747009019009949757200409333866914797127029381219525171081649367682900079983068290393154404118264018185364905606965589045505005572066630122121150375280811289992817027578011638093603433244372443437925332947876282657417807723726415290604403918202072098770116006990175350820492314867796387685661273702215556922453698175420527665425961486623775069041082819614980223231440570232620689816525157996858630797825675874156474646732065652602821773250214911095523839301872173514572945534777185829446594458412939559790823335335988943249612096741437113159733496107309438749517155816113611466181606413786593079760286476932502122540382520346014562754440684858961033148757521944516188781560550967342223679376726927253300939809903760523174681426976332580145397706760699651938934492314536611971407185558853691943983900622101911869433034988901671398749303046154807811343347079647262775389547959397251809798861843882195477113660504281821150366169039324164617598327207275003383926645719618807107118775499837007692943421107557066566151632494226460059669482223627000755320102291265532871104516620408021503469564960744840527318501733587855812003819890890023893498130260498951286347694871337136866334557342356711006118238958427510975755322669497692071461010165591733674071285408880586240632956831541705216908849696753484260512346231146506771015879263648500135313751979294236700008885800509693120930841769817301480352739004267277612475636269175159040483895116762728473969354479429135527425822803355504559236868842150825399906121046596018792183036698610028246005663710973350043476200695248674446173296357513573521498183102888985070332615743303290931992949087204064596760980551855974772314932770996526784911225488608910212901539625649853695492476183650987182998517921557222998098782725632700696246594120460326038060483755479352197136229776118789296545919836632814452748621216052104394615335775039904853067848468754958862041044060581067912446471855014833235066207766370613368257308071954943653479180111042281881188887660434936081241799850788470218012237849400298660425782403148718872653901005280466525095291577169601084339235634955604898374949141660578599870423680499360451073008559080164788699736386609233499025062855391709957273487073386537359165683384170380942428413622358059424469862102618894310733782269292492850029973291 #PART 4 ope:=Z(binomial(n,k)^2*binomial(n+k,k)^2,k,n,N) ope := (1+n)^3-(17*n^2+51*n+39)*N*(2*n+3)+(n+2)^3*N^2 seq(binomial(3000,k)^2*binomial(3000+k,k)^2,k=0..4) 1, 81054009000000, 410609341003464569252250000, 410882578525961771769517478502001000000, 130092154053223328173274235703565200017786000562500 Ini:=[1, 81054009000000] Ini := [1, 81054009000000] SeqFromRec(ope,n,N,Ini,3000)[3000] 5798638129025680733349152748046496448319790923159037834753322953934599218947188491173255493702271452214844286003427016347431818681726191820664996491275392888996857089990935426210097052676991612972366736090005873439975593589520646501994371099030131829591695547362675754826785809724984274207781369271028564257081094574573717191134887746525142396995941724491199404091874176667809346886702010517895164538171655197095117630776724387782389331004222231032357269479727963634156840872566410843452298844465149517512846345441719360221449160768783262901882646446280812911008570876247244727744998032698321472503158291514659691468164767737797870711037864451614891894044733464497124467096859550766434650387634831847176345663159724087276774186342669283342351221151958178681126612257021721231999434478246416868668972082107153507807489668127443905626051530710482036409598477726438622008073538734249735251817923481133434136198179947254013297910458882941601947817105522796991174056110070930842087025216892238814468886079309243865115261229869270546318442571256319800920233270894296573201767784803992276479054057947209587722079061167497615423493718401489468119851240022195739771758208274706358167523143050470544433044801761599502270401585970020991763971152527788180606097940836352027079470473873037823519699570253924788466645148458795199921505023085020236401604660158486220574619373215281847223264347962207787505712105287363501808722968766745309271873390922292659214154069217924212303842311163904828048945240425833968621715594694975273063970075937589870635775565522379714492627648721669428387533809923113513845997159829120604849966351775733555554434571750437849193763125821807246290938348251757266619110874213794399863081860251026991923483800589177861564820495926930762840946735610823795572866758566177260496344174897532894060354302350050942295159325046800817770604175722353695778137037603866796911557355218316203800108790228548125495570953570140355010996576027592814841304208014739127301421949883937391126976182500172283809411008045424729365812774186418282699479833509823203094602192354838203511922664212788261062186432632689340237940862510699733797822496135265349810059406761305394125093699591566597493048754103507748224420735813210900121811329542196544045606440950976091471929895912131035973396763494219949515400596092829001355499608895589643870406627512294582906239641398743847229870417675054592648951863890964473425040802166988255549322461653511022724866415170172579972721915154854763216246374135959561108537399076106758065440858308821779316923848975482172360346804002546158309447871398126105094651435858548599682307760023217732570000061561532536226849019908312550474548800411869249506356780686175460804897419132119187382632203212470376313237435112945956857349741720139217324954847132506836025330417221704110056497346391585842212614214578835788088046114957356990604518107575029803682481078752792131229586671089279284242639515811256149385105379080342490321737147074707036255358934990852041639080116172419291220228171480490330237051712120037833591792460892466003201344359538833019867182946516276343953448585158000590350370116546531942363682345569661070076142229253229619245583195002876691877865000722844521369794867655727820684126188769926680705695332343688641723511334583129000047746837724858394839866168215081409057867727435303800878009213125870470921237172631072746245359290609693788797721546894504798093540124781277173916601778974848719097739382980430729710789395528637361074110396671818144536455979747720438280919956753574998617134132206666795765522509447321107101951071559706222512018388922580268307596688343111862868076109038701733418585585549734149850974634520507050038134452812897527892748502308633976817561771389443659498371366226956525553660874076673969939441479174972068351613641046984931032547101079276551979410708478685829265706412634741301470764651859773564108626001137127759690371285160079406809333921250030344842586097309511544414968026113970654302550513471776949418341418642325003868186022716878418654958521112499452557740511783418407297112089859825483147741050825714807237839310658950829800719106480461942434183594837883471294220409862006868341123897833026342784654943005638155698372463605593128900612985654503423758310309056016578246536796804362341950247424831180946199292056175902505536091775247298098903027008244754864884549013846009652008946670740788102052308156996384706042989603489427664611821408580370428979986421198363786627257389132923513282236902008493433284226737301380961977081564139933050983195584024317791603352817202466612621712273724229275977918461251955931402925466635467267974835510756752476609322338991868183524204165403644641127175871310551021948340664874530760120548140788376342495910309904620680409855620823153708397558736501649675226271174932013115954101750533020154200339158239306480047069033231408883463415961592713540364053760540161621180447630767196675598146449990735255234069525041095156585600609766088036178574588937894582675172835154478950657098657607145585952983256031826423919611397158432582587640139883503324721138379147377168703978309767604786908325763441495670023950319604121790978706284126657819238916355130722611367538271091134916873078995375969870975755296057550543039048160902746178713192988169071926745608666951147715719224059106843104948680891890189005299137501317611221466696972345324085883857503330408138306524557380878755413858850649663094916141788722454729793151737668678097107857879067018545063165694224470533199097222237133303521895118608067224925818439490194266692591161830637454926335038258546746450598349904711992317783333645385625250692784350308728026004561582837907239075783235119627849430661154397726863759908039714174048928721621596005177292893092444584759360128892040799648168566962329411584453145436434090852060309014223030870360581357601947407220128682226883673776226031667885519683007599244670690916166192860102335179721597744308184289900322918142799977783856173278914015977551561878226007625177398938035247826723981449195184332975156260732645169182452173479447255718350706489774409140069872005612226403320453999809885748896338267524095476118080593392078254699272420921971595869854140826852934993697726169799857304115122775473934327447619937385443736216811799543241520049777241832193692719003140047012286511823931793764526249160487424407765564912298058976545155002843833471896875983411922010888902364249478637806309525519809938990876774893105018344848637001833534064746314139980672747589744595578911329750753320721963452683090920879964929179022951955984036059156735816620853788372708521735970090114276843930994925137156924868384631851877681870393761189204465755151125134631881597386701660723985733331272709165795248974737074715367623854551414489341984711922290756956857368203463206275899196087062459586864293712507379396177295155458775729083817609763865015680410392357452533666568684041423451180182382258689729856431169311537881265263497009694339371901349579390156116238921996296043871952947754892996978669720510651292713790633226473225808129757580650358682211925495517799006535050117417364727908609894967697288587118962181890410163835067200504301466078762255804995687400802037454182852819826284412732056738508587824209195259833556611593736345979378400954913877239852054860083638151385542971471582478867232235898615115651379550531148085136042883059268883420713862594537015512919238465865026595313609995827803919936076422450947922890142345779050771427691186257954920161980749919296187743614386750704357072251528402190728121435925709546612052525545342643189046380023313981654965910231868749017684855304546063361258520205441120126995785327275833247437350724456453732634124010105144731804538606303236593203654988953182406728859749059438040928329322035543642865588946937117011854997288902190433030180620705174084960110809050977242725688321360422864103628461587957721385848066053146279932690061018731685107691408452651086327767592108402739273566123652615884930236459803752136636454406798758951205173940259590022074465918766132149203502627865693244916427312504840473275882820280377781858258992553711706555257547950407644194229229230588029540924435814146983764355596931739123448271916296062783690928784504835916536142942466304261600533022768011960748832834236674053322415915696380038101171665276559812963269669673969387725111681014510597334517589613723090963654636707382386492490809481775676277229436545276845846168068785311674686762977915938158933723201395526925640204474067871599632165222020949541574368724148521013028181124023297688428707514300579897/1916188666339158423251544420229640694102294184609235407406433444901362297207715181815545981630080819343584429318254097194636584719945144350912102604700837411977433345202409766671024462217668512606165366468448751087773053024913531766435093076189564320765051476548589626184164963711521315746773138927430033789835289098113261139917861338699253587176087750853432125039377690322354707098220079460017603111826126022419485577281486971423448997777676016495674241634722292193522215885013980730554914775035687192087796574747007602960088698190337215704973285856397854797404250740527389444164905944765915120627674138646706826487995291033835592062559329689104373707155350953079147124623392812294193162444773163211466279599506635346051341242201926458189039116326672864298864907527829053878002650831575091275904652678093049322028849862256311371479883096629562480507135231332184166156695155217486672613387730927436986903537677793952002602761414274839675963676172141422672782566572051675780943080356546211331707766771955850588387065324645420660882111352990193988030908354161244378485513093351767321952970092014303687397856540177322150860304896623171548647936160677096245571469960984519858650689336676586927149505822177847570121735119205072819940557016352904074320414898520967791654570990363997345380872592140351447468424501657652435353902620954623662791260383932152803458120823365085727404537533360173834586338614659837582488987512952774772067756327455876383787533775838428305196756662548903107203364685112128403702284486729027441527233925884179638025082327411280533904378819569937838323793687930712298047791039382911789008842865303900915578584355969166285659890168632207161253076122790661298187871949722960767624231474514243798636034427194707815606058236105102706597622975035862860653949678739484285534903504202012699857138831076629473393151249544283712666604983310915657932941072907136272568736838005788473697332613023109047927535188371757989188959360187987915684257905250912821676357123271659953913690600631333138937327958598645533690636126999042632406473492306137689253900143545073553599708684559721951872566464013841271913608711891310864905560194263844694515555841043585534108349160500617183238505207801531808519753928651272474631414842486646693177503619409108943242665651320885757028343691504914511107832882681247063640356666630146969951385969364318888899664878994667903625926579378902216592892120117579455239586330375707433639085730547773851452361596081322315610960800844133652830537107504302650467404408084244728955644402454386299368451987065283746244508889032884670964026825871870543141658333127181273877310791883738170820499439081830150340113138424050863518863366394227258459034188217538771147110427948470872623178568837920154006779715090887634296241512024853509532891608518989219877657434342359321346018512643914819712235391409250897595380405283474155873470813682565845808956587530541098180094680651671646519271518639719677528535544471616652900124267016352990184185652488811480917925265368479387321507170699028361748588771901330886048917274408052990566819877368223271321640550351271838615435841676231223170148887246627357304664242771052686890457915395724447859994888596017795350079189815969758390462504182527901663483906480837839964288786714779457280331784185050676305824208434116875468015822620616819318457459869907448849357154042050073978175679795136337235671546388326024413150812563366854343104409844149718767351059361756023987813674579494973439110487890554154129382059449239446933281446485481264914290323961590648898185204418151251645055733650481045575315015810714308051713412953270128605485289424870948242096486752466743726994995165987906604651891601124440983488865598713043830228476136526467250155300334711872504447952214361875190262157170255554561201634628057471665853699129737078825530396895891126107156234114796332811543913580344540135680376591357932170778881064049098071221325470503587020800000000000 #PART 5 OddTTT3(50)[50] 1290808418002135615116 #PART 6 SimuAvDegree(Bn(9)[1],257,1000) [4507.587549, 4503.079963] The average is : 4507.587549 #PART 7 f:=1/(1-4*x-5*y+11*x*y) f := 1/(11*x*y-4*x-5*y+1) s:=DiagSeq2(f,x,y,20) s := [29, 1201, 55709, 2718241, 136499549, 6983136721, 361934838749, 18940867256641, 998610514846109, 52960778923772401, 2822254149237600029, 150996060066161512801, 8105710040251853964509, 436375297073794971041041, 23550703468724995335309149, 1273753828387177058375214721, 69022838344180991405642469149, 3746559405241737948202738305841, 203669815784776769428423626545309, 11086861078996588534031451312880801] ope:=Findrec(s,n,N,3) ope := 121*(n+1)/(n+2)-29*(2*n+3)*N/(n+2)+N^2 Ini:=[29, 1201] Ini := [29, 1201] SeqFromRec(ope,n,N,Ini,2000)[2000] 773646859915755345080592880711987868114000067411267711089645465297302185782140437651737245647882206781438666359768916791715657797616253271074975816775510891610817784007689815061811713118793808132127169156531956632210202931839862195808509640930194072475736797648958419891588400228778302107480391146576468783927091978800730725381748927502387454205436928125198975511378423794707365823379926986188749731089986500669917397396616873971504095084806867185794148201994249569708224664939358898156705285766137705808523882246825460865055845849608101602554124421655543281954942869347763265534288898345102646980249705245750411149901021906533804652856542653764498677365214438615665150615517343477647558880827613427285885357921841100046634238461334120207717747344306854642161789096422806822477126080459383319139414084891874813390575035056820274820249163621592543772865926118882829787233403086035287238779765054941813725170004414582374135508817403257313682626312641850119576783617936793647393405068210227926377575854139336013624990425865640946215471320032948282468940324846914561138775497162509724260118084959559782824445762245632299836411179392775648099505004754289691484084437878335072556789083071128828642026102198988713371433916086729092810868873365284186949520302620916959510360154686720720849426575947536973822089840926819039524739154650307471233566116603524983355463110367522269735546877184343991825037545531189756117352626296189893351782094577197526461536355028695315424139758095138975823719895497596876668131934199439173229485368636994380428110961997982663512993479753274524564588897844411090731278082694716259642257912209226715162964982766205644375213279962095754671175676851278122336924210409928907451885674299545970520895098122438167730023956375082767841919536492659592553484758514186588962566254898054642148157529356160985269637101035563320027681988296575398258581899930433851537298396125459746563645498518344619371613618855757920153091128439831385651061713354178518359400614334182811551611306246590748272172228421650703852569210285063688014891546768428033707913809454151141697846121976041016161198422075270533277284589452027578075668399593831720510523495731158754673764413760975340577700256181793723268102737700377434630624790249458797868911788044600805508485574241229253198181585117115731176981772669466598392654721571804299532408697203358580912723946227908232155338588428127174145078183468669908828952557055163469676170155844087464068982383237074344331350973287832545815695040580098426592501971544206619030825683346801296280335524080438127590769794668939223630265567779224717497406424337680111319658968840828783394398066924082596974045522418906009355130535708234172204495769135348785825545908155547519817718720637411445747313149486470464529574488009448609563739552269119003138524190110775062801488158287029560619172943034584983763324488306289724561326554924726583458117754924933611552675041469797148844028192904120049411967702119285010310450399474899988993586144695013187426300062274614261232855180913589064620769172807279547595522263494030111333199971899957574277407800812548961437147806523394123808961636877041743608198426614043951238220331970986440053143097092028066307341624392350207383551740144663484185505423935912306650375320554777485131772136130297787225160458443358096735851606998995447761379827375728762226123218580834402190682606068437153306290925913239883594710884034531237609827555387947652206110770058576176763122989223205695856623992082656117211112586521163319820736781340880001