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!)
A305878 For any number n >= 0: apply the map 0 -> "0", 1 -> "01", 2 -> "011" to the ternary representation of n and interpret the result as a binary string. 1
0, 1, 3, 2, 5, 11, 6, 13, 27, 4, 9, 19, 10, 21, 43, 22, 45, 91, 12, 25, 51, 26, 53, 107, 54, 109, 219, 8, 17, 35, 18, 37, 75, 38, 77, 155, 20, 41, 83, 42, 85, 171, 86, 173, 347, 44, 89, 179, 90, 181, 363, 182, 365, 731, 24, 49, 99, 50, 101, 203, 102, 205, 411 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
This sequence is a ternary analog of A048678.
This sequence is a permutation of A003726.
LINKS
Rémy Sigrist, Colored logarithmic scatterplot of the first 3^10 terms (where the color is function of A053735(n) + A081604(n))
FORMULA
a(0) = 0.
a(3*n) = 2*a(n).
a(3*n + 1) = 4*a(n) + 1.
a(3*n + 2) = 8*a(n) + 3.
A000120(a(n)) = A053735(n).
EXAMPLE
The first terms, alongside the ternary representation of n and the binary representation of a(n), are:
n a(n) tern(n) bin(a(n))
-- ---- ------- ---------
0 0 0 0
1 1 1 1
2 3 2 11
3 2 10 10
4 5 11 101
5 11 12 1011
6 6 20 110
7 13 21 1101
8 27 22 11011
9 4 100 100
10 9 101 1001
11 19 102 10011
12 10 110 1010
PROG
(PARI) a(n) = if (n==0, 0, my (d=n%3); a(n\3) * 2^(d+1) + (2^d-1))
CROSSREFS
Sequence in context: A195104 A338879 A257905 * A093924 A130597 A075146
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jun 13 2018
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 20 00:03 EDT 2024. Contains 371798 sequences. (Running on oeis4.)