[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
2
-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
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
(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
Sequence in context: A133625 A373926 A176154 * A028930 A112792 A138319
KEYWORD
sign
AUTHOR
Felix Fröhlich, Jul 03 2016
EXTENSIONS
More terms from Antti Karttunen, Mar 07 2018
STATUS
approved