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!)
A060585 Write n in base 3, then (working from left to right) if the k-th digit of n is not equal to the digit to its left then the k-th digit of a(n) is 1, otherwise it is 0, and finally read the result as a base-2 number. 2
0, 1, 1, 3, 2, 3, 3, 3, 2, 6, 7, 7, 5, 4, 5, 7, 7, 6, 6, 7, 7, 7, 6, 7, 5, 5, 4, 12, 13, 13, 15, 14, 15, 15, 15, 14, 10, 11, 11, 9, 8, 9, 11, 11, 10, 14, 15, 15, 15, 14, 15, 13, 13, 12, 12, 13, 13, 15, 14, 15, 15, 15, 14, 14, 15, 15, 13, 12, 13, 15, 15, 14, 10, 11, 11, 11, 10, 11, 9, 9 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
A ternary-to-binary map.
Each k appears A001316(k) times in the sequence.
LINKS
FORMULA
a(n) = 2*a(floor(n/3)) + A060584(n) = A060586(A060587(n)).
EXAMPLE
a(76) = 10 since 76 = 2211_3 and looking for changing digits produces 1010 which, read as if in binary, is 10.
PROG
(PARI) a(n) = my(v=digits(n, 3)); if(#v, forstep(k=#v, 2, -1, v[k]=(v[k]!=v[k-1])); v[1]=1); fromdigits(v, 2); \\ Kevin Ryde, Apr 15 2021
CROSSREFS
Sequence in context: A242309 A275663 A369100 * A114451 A142246 A080428
KEYWORD
base,nonn
AUTHOR
Henry Bottomley, Apr 04 2001
EXTENSIONS
Definition rewritten by Editors of OEIS, Apr 15 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 29 07:27 EDT 2024. Contains 373826 sequences. (Running on oeis4.)