The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A340300 a(n) is the number of iterations for n to reach 1 under the following scheme. If k == 0 (mod 3), then k -> k/3, if k == 1 (mod 3) k -> 2k, and if k == 2 (mod 3) add the middle two divisors of k and divide the result by 3. 1
 0, 1, 1, 3, 2, 2, 3, 2, 2, 3, 4, 4, 4, 2, 3, 5, 3, 3, 5, 2, 4, 4, 3, 3, 4, 3, 3, 4, 4, 4, 6, 4, 5, 5, 4, 5, 6, 4, 5, 4, 3, 3, 5, 3, 4, 4, 6, 6, 5, 3, 4, 5, 4, 4, 5, 3, 6, 6, 3, 3, 6, 5, 5, 4, 3, 5, 5, 4, 4, 4, 4, 4, 6, 5, 5, 4, 3, 4, 5, 3, 4, 5, 5, 5, 4, 4, 5, 4, 5, 5, 4, 3, 7, 5, 3, 5, 7, 4, 6, 5, 6, 6, 6, 4, 5 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,4 LINKS EXAMPLE a(1) = 0 since 1 is already at 1 which requires no iteration of the scheme; a(2) = 1 since (1 + 2)/3 -> 1; a(3) = 1 since 3/3 -> 1; a(4) = 3 since 4 -> 8 -> (2+4)/3 -> 2 -> 1; a(5) = 2 since 5 -> (1+5)/2 -> 2 -> 1; a(6) = 2 since 6 -> 2 -> 1. MATHEMATICA f[n_] := f[n] = Switch[ Mod[n, 3], 0, n/3, 1, 2 n, 2, lst = Divisors@ n; len = Length@lst; (lst[[len/2]] + lst[[len/2 + 1]])/3]; a[n_] := Length@NestWhileList[f@# &, n, # > 1 &]; a[n_] := Length@ NestWhileList[f@# &, n, # > 1 &] - 1; Array[a, 105] CROSSREFS Cf. A338459 (first occurrence of n). Sequence in context: A052901 A127807 A122028 * A245070 A270226 A305534 Adjacent sequences:  A340297 A340298 A340299 * A340301 A340302 A340303 KEYWORD nonn AUTHOR Ali Sada and Robert G. Wilson v, Jan 03 2021 STATUS approved

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

Last modified June 12 21:19 EDT 2021. Contains 344967 sequences. (Running on oeis4.)