It is certainly possible to implement what you want, but it takes a lot of time and extensive programming knowledge.I not a programer with this skills.
Code is slow and naive.
Using: Aria AI in Opera borwser give me:
LucasLehmerTest[n_Integer] :=
Module[{s = 4, i},
For[i = 3, i <= n, i++, s = Mod[s^2 - 2, 2^n - 1];];
If[s == 0, True, False]]
LucasLehmerTest[127]
(*True*)
primes = {3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701};
Table[LucasLehmerTest[primes[[j]]], {j, 1, Length@primes}] // AbsoluteTiming
(*{6.71683, {True, True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True, True, True,
True, True, True}}*)
Regards M.I.