Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 5000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
A029914
Start with n; repeatedly sum squares of prime factors (counted with multiplicity), until reach a prime p, then set a(n) = p; if reach a fixed point q, set a(n) = q; set a(n) = 0 if no limit exists.