T831(n)={my(s=Mod(2*polchebyshev(12,1,2),8*3^n-1)); for(i=1,n-1, s=s^3-3*s); s==4}
T831(10)
1
*** Warning: can't expand ~. *** Warning: can't expand ~.
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!