Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #24 Apr 17 2022 03:46:09
%S 2,31,11,271,38547571,11480934901,801479967311
%N a(n) is the first prime to start a sequence of exactly n primes under the iteration p -> (p^2 + 3*p + 1)/5.
%C If x_0 = a(n) and x_{k+1} = (x_k^2 + 3*x_k + 1)/5, then x_0, x_1, ..., x_{n-1} are prime but x_n is not prime.
%C For n > 1, a(n) == 1 (mod 10).
%C a(8) > 5*10^14 - _Bert Dobbelaere_, Apr 17 2022
%e a(3) = 11 because 11, (11^2 + 3*11 + 1)/5 = 31 and (31^2 + 3*31 + 1)/5 = 211 are prime but (211^2 + 3*211 + 1)/5 = 9031 is composite.
%p g:= proc(x) if isprime(x) then 1+procname((x^2+3*x+1)/5) else 0 fi end proc:
%p V:= Vector(5): V[1]:=2: count:= 1:
%p for x from 11 by 10 while count < 5 do
%p v:= g(x); if v>0 and V[v] = 0 then count:= count+1; V[v]:= x; fi;
%p od:
%p convert(V,list);
%t f[p_] := -1 + Length @ NestWhileList[(#^2 + 3*# + 1)/5 &, p, PrimeQ]; seq[len_, nmax_] := Module[{s = Table[0, {len}], p = 1, c = 0, i}, While[c < len && p < nmax, p = NextPrime[p]; i = f[p]; If[i <= len && s[[i]] == 0, c++; s[[i]] = p]]; s]; seq[5, 10^8] (* _Amiram Eldar_, Apr 11 2022 *)
%Y Cf. A352954.
%K nonn,more
%O 1,1
%A _J. M. Bergot_ and _Robert Israel_, Apr 11 2022
%E a(6) from _Amiram Eldar_, Apr 11 2022
%E a(7) from _Bert Dobbelaere_, Apr 17 2022