cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

-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

Views

Author

Felix Fröhlich, Jul 03 2016

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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++)

Extensions

More terms from Antti Karttunen, Mar 07 2018