This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A075860 #22 Sep 02 2023 10:41:00 %S A075860 0,2,3,2,5,5,7,2,3,7,11,5,13,3,2,2,17,5,19,7,7,13,23,5,5,2,3,3,29,7, %T A075860 31,2,3,19,5,5,37,7,2,7,41,5,43,13,2,5,47,5,7,7,7,2,53,5,2,3,13,31,59, %U A075860 7,61,3,7,2,5,2,67,19,2,3,71,5,73,2,2,7,5,5,79,7,3,43,83,5,13,2,2,13,89 %N A075860 a(n) is the fixed point reached when the map x -> A008472(x) is iterated, starting from x = n, with the convention a(1)=0. %C A075860 For n>1, the sequence reaches a fixed point, which is prime. %C A075860 From _Robert Israel_, Mar 31 2020: (Start) %C A075860 a(n) = n if n is prime. %C A075860 a(n) = n/2 + 2 if n is in A108605. %C A075860 a(n) = n/4 + 2 if n is in 4*A001359. (End) %H A075860 Robert Israel, <a href="/A075860/b075860.txt">Table of n, a(n) for n = 1..10000</a> %e A075860 Starting with 60 = 2^2 * 3 * 5 as the first term, add the prime factors of 60 to get the second term = 2 + 3 + 5 = 10. Then add the prime factors of 10 = 2 * 5 to get the third term = 2 + 5 = 7, which is prime. (Successive terms of the sequence will be equal to 7.) Hence a(60) = 7. %p A075860 f:= proc(n) option remember; %p A075860 if isprime(n) then n %p A075860 else procname(convert(numtheory:-factorset(n), `+`)) %p A075860 fi %p A075860 end proc: %p A075860 f(1):= 0: %p A075860 map(f, [$1..100]); # _Robert Israel_, Mar 31 2020 %t A075860 f[n_] := Module[{a}, a = n; While[ !PrimeQ[a], a = Apply[Plus, Transpose[FactorInteger[a]][[1]]]]; a]; Table[f[i], {i, 2, 100}] %t A075860 (* Second program: *) %t A075860 a[n_] := If[n == 1, 0, FixedPoint[Total[FactorInteger[#][[All, 1]]]&, n]]; %t A075860 Array[a, 100] (* _Jean-François Alcover_, Apr 01 2020 *) %o A075860 (Python) %o A075860 from sympy import primefactors %o A075860 def a(n, pn): %o A075860 if n == pn: %o A075860 return n %o A075860 else: %o A075860 return a(sum(primefactors(n)), n) %o A075860 print([a(i, None) for i in range(1, 100)]) # _Gleb Ivanov_, Nov 05 2021 %o A075860 (PARI) fp(n, pn) = if (n == pn, n, fp(vecsum(factor(n)[, 1]), n)); %o A075860 a(n) = if (n==1, 0, fp(n, 0)); \\ _Michel Marcus_, Sep 02 2023 %Y A075860 Cf. A008472 (sum of prime divisors of n), A029908. %K A075860 nonn,look %O A075860 1,2 %A A075860 _Joseph L. Pe_, Oct 15 2002 %E A075860 Better description from _Labos Elemer_, Apr 09 2003 %E A075860 Name clarified by _Michel Marcus_, Sep 02 2023