def pol(x, c): N = 35671 ** c c1 = 12172655049735206766902704703038559858384636896299329359049381021748 % N c2 = 11349632906292428218038992315252727065628405382223597973250830870345 % N c3 = 9188725924715231519926481580171897766710554662167067944757835186451 % N c4 = 8640134917502441100824547249422817926745071806483482930174015978801 % N c5 = 170423096151399242531943631075016082117474571389010646663163733960337669863762406085472678450206495375341400002076986312777537466715254543510453341546006440265217992449199424909061809647640636052570307868161063402607743165324091856116789213643943407874991700761651741114881108492638404942954408505222152223605412516092742190317989684590782541294253512675164049148557663016927886803673382663921583479090048005883115303905133335418178354255826423404513286728 % N v1 = (c1*(x**4%N)) % N v2 = (c2*(x**3%N)) % N v3 = (c3*(x**2%N)) % N v4 = (c4*(x**1%N)) % N v5 = c5 return (v1 + v2 + v3 + v4 + v5) % N def real_pol(x): N = 35671 ** 100 v1 = (12172655049735206766902704703038559858384636896299329359049381021748*(x**4)) % N v2 = (11349632906292428218038992315252727065628405382223597973250830870345*(x**3)) % N v3 = (9188725924715231519926481580171897766710554662167067944757835186451*(x**2)) % N v4 = (8640134917502441100824547249422817926745071806483482930174015978801*(x**1)) % N v5 = 170423096151399242531943631075016082117474571389010646663163733960337669863762406085472678450206495375341400002076986312777537466715254543510453341546006440265217992449199424909061809647640636052570307868161063402607743165324091856116789213643943407874991700761651741114881108492638404942954408505222152223605412516092742190317989684590782541294253512675164049148557663016927886803673382663921583479090048005883115303905133335418178354255826423404513286728 return (v1 + v2 + v3 + v4 + v5) % N p = 35671 #for i in range(p+1): # if pol(i*p + 27020, 2) == 0: # print(i) def test(value, order): global p for i in range(p+1): if pol(i*(p**order) + value, order+1) == 0: return i #test(19932572859952,3) if __name__ == '__main__': value = 27020 for order in range(1,100): #print(order) value += test(value, order) * p**order print(value) print('hex decode: '+str(hex(value)[2:-1]).decode('hex')) # 105147144336907989066550151471963186328159779305324301176294015985685113983899323674010163978217777388337139271302286127842926447191215492484691426999036830523160761311331357945508366487988584154026869443828463550483943556943640382982091699097549005203694623639540215319016261466592274497761209819811124648432382481169117517897926545072032090697328265005042477912704918066157121949336447383239423365795715407675565750145008213166879686291848752574458261376