OFFSET
1,14
COMMENTS
a(1) and a(4) are the only terms with a value of -1.
a(n) = 0 iff n is a term of A100118.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
EXAMPLE
MATHEMATICA
lim = 10^4; Table[Length@ NestWhileList[If[# == 1, 0, Total@ Flatten[Table[#1, {#2}] & @@@ FactorInteger@ #]] &, n, ! PrimeQ@ # &, 1, lim] - 2 /. {-1 -> 0, lim - 1 -> -1}, {n, 86}] (* Michael De Vlieger, Jul 03 2016 *)
PROG
(PARI) sopfr(n) = my(f=factor(n)); sum(i=1, #f[, 1], f[i, 1]*f[i, 2]) /* after Charles R Greathouse IV in A050703 */
a(n) = my(i=0, s=sopfr(n)); while(1, if(ispseudoprime(s), return(i)); if(s==sopfr(s), return(-1)); s=sopfr(s); i++)
CROSSREFS
KEYWORD
sign
AUTHOR
Felix Fröhlich, Jul 03 2016
EXTENSIONS
More terms from Antti Karttunen, Mar 07 2018
STATUS
approved