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!)
A081742 a(1)=1; then if n is a multiple of 3, a(n) = a(n/3) + 1; if n is not a multiple of 3 but even, a(n) = a(n/2) + 1; a(n) = a(n-1) + 1 otherwise. 2
1, 2, 2, 3, 4, 3, 4, 4, 3, 5, 6, 4, 5, 5, 5, 5, 6, 4, 5, 6, 5, 7, 8, 5, 6, 6, 4, 6, 7, 6, 7, 6, 7, 7, 8, 5, 6, 6, 6, 7, 8, 6, 7, 8, 6, 9, 10, 6, 7, 7, 7, 7, 8, 5, 6, 7, 6, 8, 9, 7, 8, 8, 6, 7, 8, 8, 9, 8, 9, 9, 10, 6, 7, 7, 7, 7, 8, 7, 8, 8, 5, 9, 10, 7, 8, 8, 8, 9, 10, 7, 8, 10, 8, 11, 12, 7, 8, 8, 8, 8, 9, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
A stopping problem: number of steps to reach zero starting with n and applying: x -> x/3 if x is a multiple of 3, x -> x/2 if x is even and not a multiple of 3, x -> x-1 otherwise.
LINKS
FORMULA
a(n)/log(n) is bounded.
MAPLE
f:= proc(n) option remember;
if n mod 3 = 0 then procname(n/3)+1
elif n::even then procname(n/2)+1
else procname(n-1)+1
fi
end proc:
f(1):= 1:
map(f, [$1..200]); # Robert Israel, Apr 17 2023
MATHEMATICA
a[n_] := a[n] = Which[n == 1, 1, Divisible[n, 3], a[n/3]+1, EvenQ[n], a[n/2]+1, True, a[n-1]+1];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, May 28 2023 *)
CROSSREFS
Sequence in context: A002308 A056796 A061295 * A127432 A199408 A285325
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Apr 07 2003
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 April 19 15:34 EDT 2024. Contains 371794 sequences. (Running on oeis4.)