login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A179329 Number of iterations of (n + lpf(n)) / 2 required to reach a prime, where lpf equals the least prime factor. 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,5
COMMENTS
Zeros indicate prime indices.
LINKS
EXAMPLE
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.
MATHEMATICA
f[n_] := Length@ NestWhileList[(# + FactorInteger[#][[1, 1]])/2 &, n, ! PrimeQ@ # &] - 1; Array[f, 105, 2]
CROSSREFS
Sequence in context: A077884 A331103 A267724 * A089112 A155584 A139600
KEYWORD
nonn
AUTHOR
Grant Garcia, Jan 12 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 05:39 EDT 2024. Contains 371235 sequences. (Running on oeis4.)