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!)
A371263 The run lengths transform of the balanced ternary expansion of n corresponds to the run lengths transform of the binary expansion of a(n). 4
0, 1, 2, 2, 3, 4, 5, 5, 5, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 10, 10, 10, 11, 11, 10, 10, 9, 8, 9, 10, 10, 11, 12, 13, 13, 13, 12, 13, 14, 14, 15, 16, 17, 17, 18, 19, 18, 18, 18, 19, 20, 21, 21, 22, 23, 22, 21, 21, 20, 20, 21, 21, 21, 20, 21, 22, 22, 23, 23, 22 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
For any v > 0, the value v appears A225081(v-1) times in the sequence.
LINKS
FORMULA
abs(a(n+1) - a(n)) <= 1.
EXAMPLE
The first terms, alongside the balanced ternary expansion of n and the binary expansion of a(n), are:
n a(n) bter(n) bin(a(n))
-- ---- ------- ---------
0 0 0 0
1 1 1 1
2 2 1T 10
3 2 10 10
4 3 11 11
5 4 1TT 100
6 5 1T0 101
7 5 1T1 101
8 5 10T 101
9 4 100 100
10 5 101 101
11 6 11T 110
12 6 110 110
13 7 111 111
14 8 1TTT 1000
15 9 1TT0 1001
PROG
(PARI) a(n) = { my (r = [], d, l, v = 0); while (n, d = centerlift(Mod(n, 3)); l = 0; while (centerlift(Mod(n, 3))==d, n = (n-d)/3; l++; ); r = concat(l, r); ); for (k = 1, #r, v = (v+k%2)*2^r[k]-k%2); v }
CROSSREFS
See A371256 for a similar sequence.
Sequence in context: A342879 A342880 A337774 * A069928 A135585 A081094
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 16 2024
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 30 09:01 EDT 2024. Contains 372131 sequences. (Running on oeis4.)