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.

A054575 Number of iterations to reach new prime in A054574.

Original entry on oeis.org

4, 2, 2, 2, 3, 2, 2, 2, 2, 2, 5, 2, 10, 2, 3, 3, 2, 3, 3, 3, 3, 2, 2, 2, 2, 4, 2, 3, 3, 3, 2, 3, 3, 2, 2, 6, 18, 2, 2, 2, 16, 3, 16, 4, 2, 2, 4, 3, 2, 4, 2, 2, 5, 3, 2, 3, 2, 3, 4, 6, 3, 2, 12, 10, 2, 2, 4, 2, 4, 2, 2, 10, 2, 4, 3, 2, 4, 2, 3, 2, 2, 9, 6, 2, 2, 20, 3, 2, 3, 3, 3, 2, 10, 15, 2, 2, 11, 10
Offset: 1

Views

Author

Enoch Haga, Apr 11 2000

Keywords

Examples

			a(5)=3 because beginning at 11, the next prime, 47, is attained in 3 steps.
		

Crossrefs

Cf. A054574.

Programs

  • Mathematica
    f[n_] := n + Plus @@ Times @@@ FactorInteger@n; a[n_] := Length[NestWhileList[f, (p = Prime[n]), # == p || CompositeQ[#] &]] - 1; Array[a, 100] (* Amiram Eldar, Sep 07 2019 *)