login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A289813 A binary encoding of the ones in ternary representation of n (see Comments for precise definition). 30
0, 1, 0, 2, 3, 2, 0, 1, 0, 4, 5, 4, 6, 7, 6, 4, 5, 4, 0, 1, 0, 2, 3, 2, 0, 1, 0, 8, 9, 8, 10, 11, 10, 8, 9, 8, 12, 13, 12, 14, 15, 14, 12, 13, 12, 8, 9, 8, 10, 11, 10, 8, 9, 8, 0, 1, 0, 2, 3, 2, 0, 1, 0, 4, 5, 4, 6, 7, 6, 4, 5, 4, 0, 1, 0, 2, 3, 2, 0, 1, 0, 16 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

The ones in the binary representation of a(n) correspond to the ones in the ternary representation of n; for example: ternary(42) = 1120 and binary(a(42)) = 1100 (a(42) = 12).

See A289814 for the sequence encoding the twos in ternary representation of n.

By design, a(n) AND A289814(n) = 0 (where AND stands for the bitwise AND operator).

See A289831 for the sum of this sequence and A289814.

For each pair of numbers without common bits in base 2 representation, say x and y, there is a unique index, say n, such that a(n) = x and A289814(n) = y; in fact, n = A289869(x,y).

The scatterplot of this sequence vs A289814 looks like a Sierpinski triangle pivoted to the side.

For any t > 0: we can adapt the algorithm used here and in A289814 in order to uniquely enumerate every tuple of t numbers mutually without common bits in base 2 representation.

LINKS

Rémy Sigrist, Table of n, a(n) for n = 0..6560

FORMULA

a(0) = 0.

a(3*n) = 2 * a(n).

a(3*n+1) = 2 * a(n) + 1.

a(3*n+2) = 2 * a(n).

Also, a(n) = A289814(A004488(n)).

A053735(n) = A000120(a(n)) + 2*A000120(A289814(n)). - Antti Karttunen, Jul 20 2017

EXAMPLE

The first values, alongside the ternary representation of n, and the binary repesentation of a(n), are:

n       a(n)    ternary(n)  binary(a(n))

--      ----    ----------  ------------

0       0       0           0

1       1       1           1

2       0       2           0

3       2       10          10

4       3       11          11

5       2       12          10

6       0       20          0

7       1       21          1

8       0       22          0

9       4       100         100

10      5       101         101

11      4       102         100

12      6       110         110

13      7       111         111

14      6       112         110

15      4       120         100

16      5       121         101

17      4       122         100

18      0       200         0

19      1       201         1

20      0       202         0

21      2       210         10

22      3       211         11

23      2       212         10

24      0       220         0

25      1       221         1

26      0       222         0

MATHEMATICA

Table[FromDigits[#, 2] &[IntegerDigits[n, 3] /. 2 -> 0], {n, 0, 81}] (* Michael De Vlieger, Jul 20 2017 *)

PROG

(PARI) a(n) = my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==1, 1, 0)), 2)

(Python)

from sympy.ntheory.factor_ import digits

def a(n):

    d=digits(n, 3)[1:]

    return int("".join(['1' if i==1 else '0' for i in d]), 2)

print map(a, xrange(101)) # Indranil Ghosh, Jul 20 2017

CROSSREFS

Cf. A000120, A004488, A005836, A053735, A289814, A289831, A289869.

Sequence in context: A100219 A079757 A071493 * A050075 A247490 A002120

Adjacent sequences:  A289810 A289811 A289812 * A289814 A289815 A289816

KEYWORD

nonn,base,look

AUTHOR

Rémy Sigrist, Jul 12 2017

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 21 19:59 EST 2019. Contains 319350 sequences. (Running on oeis4.)