%I #21 Jan 28 2025 15:30:14
%S 0,0,1,0,1,0,1,1,1,0,1,0,2,2,1,0,1,0,1,2,1,0,1,1,3,1,2,0,2,0,1,3,1,2,
%T 1,0,3,2,1,0,2,0,1,2,2,0,1,1,1,2,3,0,1,2,2,2,1,0,2,0,4,2,1,2,2,0,1,4,
%U 3,0,1,0,3,2,3,2,2,0,1,1,1,0,2,2,3,2,1,0,2,2,2,2,2,2,1,0,2,3,1,0
%N Number of iterations of sopf until reaching a prime.
%H Antti Karttunen, <a href="/A361685/b361685.txt">Table of n, a(n) for n = 2..65537</a>
%F For n >= 2, a(n) = min{m : sopf^m(n) is prime} where sopf^m indicates m iterations of sopf, the sum of the prime factors function.
%F a(n) = A321944(n) - 1. - _Rémy Sigrist_, Mar 29 2023
%e a(15) = 2 because 15 is not prime, sopf(15) = 8 is not prime, and sopf^2(15) = sopf(8) = 2 is prime.
%e a(16) = 1 because 16 is not prime and sopf(16) = 2 is prime.
%e a(17) = 0 because 17 is prime.
%o (MATLAB)
%o for n=2:101
%o s = n;
%o c = 0;
%o while ~isprime(s)
%o s = sum(unique(factor(s)));
%o c = c + 1;
%o end
%o a(n) = c;
%o end
%o (PARI)
%o A008472(n) = vecsum(factor(n)[, 1]);
%o A361685(n) = for(k=0,oo,if(isprime(n),return(k)); n = A008472(n)); \\ _Antti Karttunen_, Jan 28 2025
%Y Cf. A008472 (sopf), A321944.
%K nonn,changed
%O 2,13
%A _J. W. Montgomery_, Mar 29 2023