Re: Xn+1==(sqrt(5*Xn*Xn+4*(-1)^n)+Xn)/2

first for bound=1e5,using matirx power to compute x0,x1 x[bound],x[bound+1] ,x[2*bound],x[2*bound+1]..... upper bound is 2*p using map to record (x[i*bound],x[i*bound+1])

I use this formula and discrete log algo to find candidate of xn+1

then continue to compute xn-1 xn-2 .... until we find (xi,xi+1) in the map then it is valid

otherwise it is invalid

complex : sqrt(p*log(p))

*Edited by author 02.12.2017 15:17*