login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 0
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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

a(n) is 1 + the number of iterations of n -> A008472(n) until n = A008472(n) or n=0.

The fixed points are in A075860.

For n>1 the fixed point is a prime number.

LINKS

Table of n, a(n) for n=1..65.

EXAMPLE

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.

For n=2: 2->{2} 2, 1 term found {2}, therefore a(2) = 1.

For n=1: 1->{} 0, 2 term found {1,0}, therefore a(1) = 2.

MATHEMATICA

s[n_] := DivisorSum[n, # &, PrimeQ[#] &]; a[1] = 2; a[n_] := Length[ FixedPointList[s, n]] - 1; Array[a, 60, 0] (* Amiram Eldar, Dec 12 2018 *)

PROG

(C++)

int Sum(int x){int acum=0, i=-1; for(; primes[++i]<=x; )if(!(x%primes[i])) acum+=primes[i]; return acum; }

int a(int n){int cn=0, last=n; while(1){cn++; n=Sum(n); if(n==last)break; last=n; } return cn; }

(PARI) a(n)={my(k=1); while(n&&!isprime(n), k++; n=vecsum(factor(n)[, 1])); k} \\ Andrew Howroyd, Dec 12 2018

CROSSREFS

Cf. A008472, A075860, A002217

Sequence in context: A105103 A086669 A053574 * A065203 A230798 A266224

Adjacent sequences:  A321941 A321942 A321943 * A321945 A321946 A321947

KEYWORD

nonn

AUTHOR

Wilmer Emiro Castrillon Calderon, Dec 12 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 06:30 EDT 2019. Contains 322237 sequences. (Running on oeis4.)