Tags: crypto math 

Rating:

If `bit == 0`, there must be even multiples of `6` in factorization of `c`,

if `bit == 1`, there must be odd multiples of `6` in factorization of `c`.
```py
from pwn import *
p = remote('lac.tf',31190)
n = int(p.recvline().decode().split(' = ')[-1])
a = int(p.recvline().decode().split(' = ')[-1])
for i in range(150):
c = int(p.recvline().decode().split(' = ')[-1])
p.recvuntil(b'What is your guess? ')
cnt = 0
while c % 6 == 0:
cnt += 1
c //= 6
if cnt % 2 == 0:
p.sendline(b'0')
else:
p.sendline(b'1')
p.interactive()
# lactf{sm4ll_pla1nt3xt_sp4ac3s_ar3n't_al4ways_e4sy}
```

Original writeup (https://tiefsee5037008.github.io/posts/LA-CTF-Writeup/#guess-the-bit).