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.

A230305 Iterate A080670 starting at n; a(n) = number of steps to reach a prime, or -1 if no prime is ever reached.

Original entry on oeis.org

0, 0, 2, 0, 1, 0, 1, 4, 3, 0, 1, 0, 3, 4, 2, 0, 3, 0
Offset: 2

Views

Author

N. J. A. Sloane, Oct 27 2013

Keywords

Comments

If n is a prime, a(n) = 0.
a(20) is presently unknown - see A195265 for the trajectory.

Examples

			9 -> 32 -> 25 -> 52 -> 2213, which is prime, taking 4 steps, so a(9) = 4.
		

Crossrefs

Cf. A080670, A195264 (the prime that is reached), A195265, A067599, A037271 (home primes).

Programs

  • Mathematica
    fn[n_] := FromDigits[Flatten[IntegerDigits[DeleteCases[Flatten[FactorInteger[n]], 1]]]];
    Map[Length, Table[NestWhileList[fn, n, # != 1 && ! PrimeQ[#] &], {n, 2,
    19}], {1}] - 1 (* Robert Price, Mar 16 2020 *)