Input is a boolean array a_0,i with at most 1000,000 elements.
each time the new array is made by xor of adjacent(cyclic) elements in previous array:
a_t,i = a_t-1,i ^ a_t-1,(i+1)%n // n is size of input
The p-th array(a_p,i) is wanted.(p <= 1000,000,000).
According to high bound on p I think maybe there is a structure of arrays or maybe the array can be calculated in O(lg(p) * n).
If t is a power of two (t=2k),
Also, if t is a sum of two components, and one of them is a power of two (t = v + w, w=2m),
This allows using binary representation of p to recursively compute the resulting array. The complexity is as requested: O(lg(p) * n):