login
Set x = n. Then a(n) is the number of iterations of successive applications of the map x = A001414(x) that leave x composite, or a(n) = -1 if x always remains composite.
1

%I #34 Mar 24 2018 18:52:14

%S -1,0,0,-1,0,0,0,1,1,0,0,0,0,2,2,2,0,2,0,2,1,0,0,2,1,3,2,0,0,1,0,1,3,

%T 0,1,1,0,2,3,0,0,1,0,3,0,2,0,0,3,1,3,0,0,0,3,0,1,0,0,1,0,4,0,1,3,3,0,

%U 2,4,3,0,1,0,4,0,0,3,3,0,0,1,0,0,3,1,1,2,0,0,0,3,3,1,4,3,0,0,3,0,3,0,1,0,0,3

%N Set x = n. Then a(n) is the number of iterations of successive applications of the map x = A001414(x) that leave x composite, or a(n) = -1 if x always remains composite.

%C a(1) and a(4) are the only terms with a value of -1.

%C a(n) = 0 iff n is a term of A100118.

%H Antti Karttunen, <a href="/A274718/b274718.txt">Table of n, a(n) for n = 1..65537</a>

%e For n = 26: A001414(26) = 15, A001414(15) = 8, A001414(8) = 6 and A001414(6) = 5. 5 is prime and so 26 remains composite through 3 iterations of the map given in the definition, therefore a(26) = 3.

%t 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 *)

%o (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 */

%o 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++)

%Y Cf. A001414, A100118.

%K sign

%O 1,14

%A _Felix Fröhlich_, Jul 03 2016

%E More terms from _Antti Karttunen_, Mar 07 2018