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 A321944 #48 Mar 31 2023 09:17:29 %S A321944 2,1,1,2,1,2,1,2,2,2,1,2,1,3,3,2,1,2,1,2,3,2,1,2,2,4,2,3,1,3,1,2,4,2, %T A321944 3,2,1,4,3,2,1,3,1,2,3,3,1,2,2,2,3,4,1,2,3,3,3,2,1,3,1,5,3,2,3,3,1,2, %U A321944 5,4,1,2,1,4,3,4,3,3,1,2,2,2,1,3,3,4,3,2,1,3 %N A321944 Starting from n, repeatedly compute the sum of the prime divisors until a fixed point or 0 is reached; a(n) is the number of terms, including n. %C A321944 a(n) is 1 + the number of iterations of n -> A008472(n) until n = A008472(n) or n=0. %C A321944 The fixed points are in A075860. %C A321944 For n>1 the fixed point is a prime number. %H A321944 Robert Israel, <a href="/A321944/b321944.txt">Table of n, a(n) for n = 1..10000</a> %e A321944 For n=21: 21->{3,7} 3+7=10, 10->{2,5} 2+5=7, 7->{7} 7; 3 terms found {21,10,7}, therefore a(21) = 3. %e A321944 For n=2: 2->{2} 2, 1 term found {2}, therefore a(2) = 1. %e A321944 For n=1: 1->{} 0, 2 term found {1,0}, therefore a(1) = 2. %p A321944 f:= proc(n) option remember; %p A321944 if isprime(n) then 1 %p A321944 else 1+procname(convert(numtheory:-factorset(n),`+`)) %p A321944 fi %p A321944 end proc: %p A321944 f(1):= 2: %p A321944 map(f, [$1..100]); # _Robert Israel_, Mar 30 2020 %t A321944 s[n_] := DivisorSum[n, # &, PrimeQ[#] &]; a[1] = 2; a[n_] := Length[ FixedPointList[s, n]] - 1; Array[a, 60, 0] (* _Amiram Eldar_, Dec 12 2018 *) %o A321944 (C++) %o A321944 int Sum(int x){int acum=0,i=-1; for(;primes[++i]<=x;)if(!(x%primes[i])) acum+=primes[i]; return acum;} %o A321944 int a(int n){int cn=0,last=n;while(1){cn++;n=Sum(n);if(n==last)break;last=n;} return cn;} %o A321944 (PARI) a(n)={my(k=1); while(n&&!isprime(n), k++; n=vecsum(factor(n)[, 1])); k} \\ _Andrew Howroyd_, Dec 12 2018 %Y A321944 Cf. A008472, A075860, A002217. %K A321944 nonn %O A321944 1,1 %A A321944 _Wilmer Emiro Castrillon Calderon_, Dec 12 2018