Now one by one perform Lucas Primality Test on random numbers generated .
for i in range ( n - 2 ) : NEW_LINE INDENT a = rand [ i ] NEW_LINE if ( power ( a , n - 1 , n ) != 1 ) : NEW_LINE INDENT return " composite " NEW_LINE DEDENT DEDENT