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.

A179329 Number of iterations of (n + lpf(n)) / 2 required to reach a prime, where lpf equals the least prime factor.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 1, 3, 3, 0, 1, 0, 2, 4, 4, 0, 4, 0, 1, 2, 2, 0, 1, 5, 3, 5, 5, 0, 5, 0, 1, 5, 5, 2, 1, 0, 2, 3, 3, 0, 3, 0, 1, 2, 2, 0, 6, 6, 4, 6, 6, 0, 6, 6, 1, 6, 6, 0, 1, 0, 2, 6, 6, 3, 6, 0, 3, 2, 2, 0, 1, 0, 3, 4, 4, 4, 4, 0, 1, 4, 4, 0, 1, 3, 2, 3, 3, 0, 3, 7, 1, 7, 7, 5, 7, 0, 5, 7, 7, 0, 7, 0, 1, 7, 7
Offset: 2

Views

Author

Grant Garcia, Jan 12 2011

Keywords

Comments

Zeros indicate prime indices.

Examples

			a(15) gives (15 + 3) / 2 = 9, (9 + 3) / 2 = 6, (6 + 2) / 2 = 4, (4 + 2) / 2 = 3. Four iterations were required to reach a prime, so a(15) = 4.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length@ NestWhileList[(# + FactorInteger[#][[1, 1]])/2 &, n, ! PrimeQ@ # &] - 1; Array[f, 105, 2]