Code:

2(k)(n)+1 -> 2(2(k)(n)+1)^2-1 -> 8(k^2)(n^2)+8(k)(n)+1 -> 8(k)(n)(n+1)+8(k^2)+8(k)+1
a(2(k)(n)+1)->2(a(2(k)(n)+1))^2-1 -> (a^2)(2(2(k)(n)+1)^2-1 ->(a^2)(8(k^2)(n^2)+8(k)(n)+1) -> (a^2)(8(k)(n)(n+1)+8(k^2)+8(k)+1)

k are related to

fermat quotients
a are the values that are s_n divided by the mersenne primes in that form of the test.