OFFSET
1,1
COMMENTS
a(n) is always prime. a(p) = p for every prime p. The prime number 2 appears just two times (n = 1, 2). For composite n, a(n) is typically a smaller prime; numerics suggest strong bias toward primes p with p-1 having only small factors (notably 2 and 3). For 1 <= n <= 5000, the most frequent limiting primes are: 3 (1057 times), 5 (946), 13 (234), 73 (224), 433 (65), 1153 (52), etc.
The sequence generalizes in two dimensions A039650 ("Prime reached by iterating f(x) = phi(x)+1 on n"), because it could be extended to an infinite two-dimensional matrix T(i,j), so as to start with a generic pair of seeds x(0), x(1) (both greater than 2, to ensure that the result is always integer). In this case, the sequence in question would represent the diagonal T(n,n) of the matrix.
LINKS
Augusto Santi, Table of n, a(n) for n = 1..5000
Thomas Bloom, Problem 409, Erdős Problems.
Augusto Santi, A sequence based on Euler's totient function that always converges to prime numbers, Mathematics StackExchange, 2025.
EXAMPLE
For n = 4, 1+(phi(4)+phi(4))/2 = 1+(2+2)/2 = 3; 1+(phi(3)+phi(4))/2 = 1+(2+2)/2 = 3; 1+(phi(3)+phi(3))/2 = 1+(2+2)/2 = 3, therefore a(4) = 3.
MATHEMATICA
a[n_] := NestWhile[{Last[#], 1 + Total[EulerPhi[#]]/2} &, {n, n}, ! (Equal @@ # && PrimeQ[First[#]]) &][[1]]; Array[a, 100] (* Amiram Eldar, Nov 10 2025 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Augusto Santi, Nov 09 2025
STATUS
approved
