Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #8 Jul 01 2022 22:16:23
%S 5,11,17,23,29,107,41,47,53,59,197,71,233,83,89,863,101,107,113,359,
%T 2480057,131,137,431,149,467,4373,167,173,179,557,191,197,5507,1889,
%U 647,1997,227,233,239,2213,251,257,263,269,827,281,863,293,2699,2753,311,317
%N a(n) is the prime reached after A354747(n) steps when repeatedly applying the map x -> 3*x+2 to 2*n-1, or 0 if no prime is ever reached.
%C Is a(100943) = 0?
%C If not 0, a(100943) >= 10^10000. - _Michael S. Branicky_, Jun 07 2022
%o (PARI) a(n) = my(x=2*n-1); while(1, x=3*x+2; if(ispseudoprime(x), return(x)))
%o (Python)
%o from sympy import isprime
%o def f(x): return 3*x + 2
%o def a(n):
%o fn, c = f(2*n-1), 1
%o while not isprime(fn): fn, c = f(fn), c+1
%o return fn
%o print([a(n) for n in range(1, 54)]) # _Michael S. Branicky_, Jun 07 2022
%Y Cf. A052333, A354747.
%K nonn
%O 1,1
%A _Felix Fröhlich_, Jun 06 2022