The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A350657 a(n) is the greatest value of the orbit of n under repeated application of A350229 (the sum of a number and its balanced ternary digits). 1
0, 2, 2, 6, 6, 6, 6, 8, 8, 14, 14, 14, 14, 16, 14, 15, 16, 17, 18, 20, 20, 24, 24, 24, 24, 26, 26, 32, 32, 32, 32, 44, 32, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 46, 47, 48, 50, 50, 51, 52, 53, 54, 56, 56, 60, 60, 60, 60, 62, 62, 68, 68, 68, 68 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
The sequence { a(n) - n, n >= 0 } has no upper limit (this because the sequence A065363 can be positive on arbitrarily large intervals).
LINKS
EXAMPLE
For n = 9:
- the orbit of 9 contains the following values:
k v bter(v) ds(v)
- -- ------- -----
0 9 100 1
1 10 101 2
2 12 110 2
3 14 1TTT -2
4 12 110 2
- so a(9) = max({ 9, 10, 12, 14 }) = 14.
MATHEMATICA
f[n_] := n + Total[If[First@ # == 0, Rest@ #, #] &[Prepend[IntegerDigits[n, 3], 0] //. {x___, y_, k_ /; k > 1, z___} :> {x, y + 1, k - 3, z}]]; Array[Max@ NestWhileList[f, #, UnsameQ, All] &, 67, 0] (* Michael De Vlieger, Jan 15 2022 *)
PROG
(PARI) b(n) = my (v=n, d); while (n, n=(n-d=[0, 1, -1][1+n%3])/3; v+=d); v
a(n) = my (s=[]); while (!setsearch(s, n), s=setunion(s, [n]); n=b(n)); s[#s]
CROSSREFS
Sequence in context: A324032 A196872 A319865 * A140219 A259225 A300951
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 10 2022
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 June 5 14:50 EDT 2024. Contains 373107 sequences. (Running on oeis4.)