A029913 Start with n; if prime, stop; repeatedly sum squares of prime factors (counted with multiplicity), until reach 16 or a prime; set a(n) = 0 if no limit exists.
2, 3, 17, 5, 13, 7, 17, 59, 29, 11, 17, 13, 53, 293, 16, 17, 59, 19
Offset: 2
Examples
9 -> 3^2 + 3^2 = 18 -> 4 + 9 + 9 = 22 -> 4 + 121 = 125 -> 25 + 25 + 25 = 75 -> 9 + 25 + 25 = 59, so a(9) = 59.
Crossrefs
Cf. A029914.
Extensions
More terms from Michel ten Voorde, Apr 12 2001
Incorrect extension reverted by Sean A. Irvine, Mar 08 2020