%I #13 Feb 02 2022 15:08:44
%S 3,11,17,7,25781659,13505561767
%N a(n) is the least prime that begins a sequence of exactly n primes under iteration of the map x -> (x^2+2)/3.
%e 7 is prime, (7^2+2)/3 = 17 is prime, (17^2+2)/3 = 97 is prime, (97^2+2)/3 = 3137 is prime, but (3137^2+2)/3 = 3280257 is not prime, so 7 begins the sequence of 4 primes (7, 17, 97, 3137). Since this is the first prime to do so, a(4) = 7.
%p f:= proc(p) option remember; local q;
%p q:= (p^2+2)/3;
%p if isprime(q) then 1 + procname(q) else 1 fi
%p end proc:
%p A:= Vector(5): count:= 0:
%p p:= 3:
%p while count < 5 do
%p p:= nextprime(p);
%p v:= f(p);
%p if A[v] = 0 then A[v]:= p; count:= count+1; fi;
%p od:
%p convert(A,list);
%t f[n_] := -1 + Length @ NestWhileList[(#^2 + 2)/3 &, n, PrimeQ]; a[n_] := Module[{p = 3}, While[f[p] != n, p = NextPrime[p]]; p]; Array[a, 4] (* _Amiram Eldar_, Feb 01 2022 *)
%Y Cf. A109953.
%K nonn,more
%O 1,1
%A _J. M. Bergot_ and _Robert Israel_, Jan 30 2022
%E a(6) from _Amiram Eldar_, Feb 01 2022
|