## Newman–Shanks–Williams prime

Problem Statement A Newman–Shanks–Williams prime (NSW prime) is nothing but a prime number which can be represented in a specific form given the following formula: So we need to find nth NSW prime. Example n = 3 7 Explanation S0 = 1, S1 = 1, S2 = 2*S1 + S0 …