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!)
A359194 Binary complement of 3n. 17
1, 0, 1, 6, 3, 0, 13, 10, 7, 4, 1, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3, 0, 61, 58, 55, 52, 49, 46, 43, 40, 37, 34, 31, 28, 25, 22, 19, 16, 13, 10, 7, 4, 1, 126, 123, 120, 117, 114, 111, 108, 105, 102, 99, 96, 93, 90, 87, 84, 81, 78, 75, 72, 69, 66, 63, 60, 57 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
The binary complement takes the binary value of a number and turns any 1s to 0s and vice versa. This is equivalent to subtracting from the next larger Mersenne number.
It is currently unknown whether every starting positive integer, upon iteration, reaches 0.
From M. F. Hasler, Dec 26 2022: (Start)
This map enjoys the following properties:
(P1) a(2n) = a(n)*2 + 1 (since 3*(2n) is 3*n shifted one binary digit to the left, and the one's complement yields that of 3*n with a '1' appended.
(P2) As an immediate consequence of (P1), all even-indexed values are odd.
(P3) Also from (P1), by immediate induction we have a(2^n) = 2^n-1 for all n >= 0.
(P4) Also from (P1), a(4n) = a(n)*4 + 3.
(P5) Similarly, a(4n+1) = a(n)*4 (because the 1's complement of 3 is 0)/
(P6) From (P5), a(n) = 0 for all n in A002450 (= (4^k-1)/3). [For the initial value at n = 0 the discrepancy is explained by the fact that the number 0 should be considered to have zero digits, but here the result is computed with 0 considered to have one binary digit.] (End)
LINKS
FORMULA
a(n) = A035327(3n).
a(n) = 0 iff n belongs to A002450 \ {0}. - Rémy Sigrist, Dec 22 2022
EXAMPLE
a(7) = 10 because 3*7 = 21 = 10101_2, whose binary complement is 01010_2 = 10.
a(42) = 1 because 3*42 = 126 = 1111110_2, whose binary complement is 0000001_2 = 1.
a(52) = 99 by
3*n = binary 10011100
complement = binary 01100011 = 99.
PROG
(Python)
def a(n): return 1 if n == 0 else (m:=3*n)^((1 << m.bit_length()) - 1)
print([a(n) for n in range(67)]) # Michael S. Branicky, Dec 20 2022
(PARI) a(n)=if(n, bitneg(3*n, exponent(3*n)+1), 1) \\ Rémy Sigrist, Dec 22 2022
CROSSREFS
Trisection of A035327.
Cf. A002450, A020988 (indices of 1's).
Cf. A256078.
Sequence in context: A153459 A102525 A119923 * A204420 A331570 A102410
KEYWORD
nonn,base,easy
AUTHOR
Joshua Searle, Dec 19 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 May 5 18:06 EDT 2024. Contains 372277 sequences. (Running on oeis4.)