This is an immediate successor of Chebyshev polynomials of the first kind and primality testing and does not have any other motivation - although original motivation seems to be huge since a positive answer (if not too complicated) would give a very efficient primality test (see the linked question for details).
Recall that the Chebyshev polynomials Tn(x) are defined by T0(x)=1, T1(x)=x and Tn+1(x)=2xTn(x)−Tn−1(x), and there are several explicit expressions for their coefficients. Rather than writing them down (you can find them at the Wikipedia link anyway), let me just give a couple of examples: T15(x)=−15x(1−47⋅82⋅3x2+426⋅7⋅8⋅92⋅3⋅4⋅5x4−438⋅9⋅102⋅3⋅4x6+4410⋅112⋅3x8−45122x10+46x12)+47x15 T17(x)=17x(1−48⋅92⋅3x2+427⋅8⋅9⋅102⋅3⋅4⋅5x4−438⋅9⋅10⋅112⋅3⋅4⋅5x6+4410⋅11⋅122⋅3⋅4x8−4512⋅132⋅3x10+46142x12−47x14)+48x17 It seems that n is a prime if and only if all the ratios in the parentheses are integers; this is most likely well known and easy to show.
The algorithm described in the above question requires determining whether, for an odd n, coefficients of the remainder from dividing Tn(x)−xn by xr−1, for some fairly small prime r (roughly ∼logn) are all divisible by n. In other words, denoting by aj, j=0,1,2,... the coefficients of Tn(x)−xn, we have to find out whether the sum sj:=aj+aj+r+aj+2r+... is divisible by n for each j=0,1,...,r−1.
The question then is: given r and n as above (n odd, r a prime much smaller than n), is there an efficient method to find these sums sj without calculating all aj? I. e., can one compute Tn(x) modulo xr−1 (i. e. in a ring where xr=1) essentially easier than first computing the whole Tn(x) and then dividing by xr−1 in the ring of polynomials?
(As already said, only the question of divisibility of the result by n is required; also r is explicitly given (it is the smallest prime with n not ±1 modulo r). This might be easier to answer than computing the whole polynomials mod xr−1.)