%I #34 Dec 24 2020 21:10:05
%S 2,7,5,59,1657459
%N a(n) is the first prime to start a sequence of exactly n primes under the iteration p -> p + (p^2-1)/12.
%C No further terms up to 10^8.
%e a(3) = 5 because 5 starts a sequence of exactly 3 primes: 5 -> 5+(5^2-1)/12 = 7 -> 7+(7^2-1)/12 = 11, while 11 + (11^2-1)/12 = 21 is not prime, and 5 is the first prime to do so.
%p g:= p -> p + (p^2-1)/12:
%p f:= proc(p)
%p if not isprime(p) then 0
%p else 1 + procname(g(p))
%p fi
%p end proc:
%p A:= Vector(5): A[1]:= 2: count:= 1:
%p p:= 3:
%p while count < 5 do
%p p:= nextprime(p);
%p v:= f(p);
%p if A[v] = 0 then count:= count+1; A[v]:= p; fi
%p od:
%p convert(A,list);
%K nonn,more
%O 1,1
%A _J. M. Bergot_ and _Robert Israel_, Dec 24 2020
|