%I #14 Sep 08 2022 08:45:31
%S 2,3,2,3,163,19,151,263,131,3041,311,401,2029,1163,2309,157,541,61,
%T 739,563,1097,4813,1801,1399,709,317,14563,863,5479,337,2351,9533,
%U 4931,401,1117,14639,17791,1409,571,5171,16633,7001,2129,10891,31151,22709,6079,883,20113
%N Least prime P such that P^(2*prime(n))-P^prime(n)-1 is prime with prime(n) the n-th prime.
%H Daniel Suteu, <a href="/A131580/b131580.txt">Table of n, a(n) for n = 1..100</a>
%e 2^(2*2)-2^2-1=11 prime, 2 is prime, so P = a(1) = 2.
%e 2^(2*3)-2^3-1=55 composite; 3^(2*3)-3^3-1=701 prime, 3 is prime so P = a(2) = 3.
%o (PARI) a(n) = my(p = prime(n), P=2); while(!isprime(P^(2*p)-P^p-1), P = nextprime(P+1)); P; \\ _Michel Marcus_, Sep 15 2019
%o (Magma) sol:=[]; for n in [1..31] do p:=2; while not IsPrime(p^(2*q)-p^ NthPrime(n)-1) where q is NthPrime(n) do p:=NextPrime(p); end while; Append(~sol,p); end for; sol; // _Marius A. Burtea_, Sep 15 2019
%K nonn
%O 1,1
%A _Pierre CAMI_, Aug 29 2007
%E a(33)-a(49) from _Daniel Suteu_, Sep 15 2019