ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1857. Alice and Bandersnatch

rt
I think yes. Take N = large prime < 10000
luckysundog some test // Problem 1857. Alice and Bandersnatch 3 Oct 2011 09:20
a = 2, n = 9973

answer:
14904621025037755827437797995029148880362779866424715224693517820463009454475004079109250480192543646387624482279333659821215987759397192199402698178570311506330066011775238706905025775726022774246268754262032508986445304597362806225477043574838686542880766042808796191774352204481264778444142789019836249807116531102240540605513821901445901663187472630057457969799648823443392502700534032831356400169476525651642297889350990851204394323787093930031883520345706191614002116875588321182812154260675684639421303259469046652793704537031887769166714666686960541140927151799730820463065843135051664547781192503566681022807547283837937447726097345898253220818229436556149642670109674354191911162211716918319318073680863049897407347820098248296412835402715937982002537589829286535196652228063482216305707447303536787124054130575993263170794164909495195651645422585065090643367406384429429578708377901955634386620729617803925670438766186672314389645511730975442024020429962394636651116208556757442483186739035475367021090549369129539177986487053285247695976135385526205576733425135929159788523981080812725240119296466227495326704835968047199608472902140469997188152235908949890841781967920370089122293539758097721347540802867688355790553065047888155115287811655356665957137290723305539167231316534741334021423295743877523299501367085338991162597068343780433661716731387258664246077446618233181858158657960718766053804473919050092713821711406953787911832864607724974491843551178833816125710835581531470831596269636800612035063228083130860108099103489674421541817624972166957707407779067922167792541589765967736263888135269252756031592565649232802082035865681184001381691112692334872504387438579612873188200519003474606555441952935633195083328469007463332515126452408810528548753084966102155531344217416123113215586327568007095917343446067967846026646136021781181626604810853227911481990872617964455217573983666565303616799206895795639868767566832723767517437483913468354733532900900307403923066181764608937339262669074502018234482378957090895710136112680697270530682468428279007651724592183441330390818064367833332463993139961219833062713957549687709215488858758927424198743032271608302001316448288578282506259262773570160529417731568452798742120264923462568437050849588881209635597875968582954059274022498193635995355658285645058845628518672278012309009414624036450276532247323177230707410100725900993832774676945292169965700968342164050535861215840518175772043029213734893179100688792327438057948602236752629195676964550122874634575458536126250900269270214887345688417717125685990945800804095277189428817703029472732348189976235833579333916007892166957620514997404350846962152715910897498706786818836087100944657200732065266030236426886527771394620476174311684791307107877655299724699301194683636159674939221997138507367761440822014719822558207186413062132372751593414309760965821186199881516398081346982077950241637922065686888122542154174583604138945920444946377439121232301200968037880734043632458159430