|
|
A274718
|
|
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
|
|
|
-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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
EXAMPLE
|
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.
|
|
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
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|