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!)
A347111 a(n) is n in binary rendered as a base-10 number minus n in ternary rendered as a base-10 number. 0
0, 8, 1, 89, 89, 90, 90, 978, 901, 909, 909, 990, 990, 998, 991, 9879, 9879, 9810, 9810, 9898, 9891, 9899, 9899, 10780, 10780, 10788, 10011, 10099, 10099, 10100, 10100, 98988, 98981, 98989, 98989, 99000, 99000, 99008, 99001, 99889, 99889, 99890, 99890, 99978 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Theorem: a(6k - 2) = a(6k - 1), a(6k) = a(6k + 1), and a(6k + 2) != a(6k + 3) for all positive integers k.
Proof: a(6k - 2) in binary has a last digit of 0 and in ternary has a last digit of 1. a(6k - 1) is unchanged in both binary and ternary except for the last digit, which is increased by one in both bases. Since the 0 becomes a 1 in the binary number, which is a valid digit in binary, and the 1 becomes a 2 in the ternary number, which is a valid digit in ternary, the base-10 difference between the two numbers is the same.
The proof of the equality of a(6k) and a(6k + 1) is essentially the same; the binary and ternary numbers have last digits of 0, and those numbers plus 1 have last digits of 1; therefore the difference is the same.
In the last part of the theorem, a(6k + 2) != a(6k + 3), the binary number will increase by 1 when rendered in base 10. However, the ternary number's second to last digit will change because the last digit goes from 2 to 0. This means that there is an increase in the number not equal to one. Therefore the differences are different.
Theorem: a(n) contains only the digits 0, 1, 7, 8, and 9.
Proof: When we subtract the numbers in base 10, the possible digits of the difference are all of the possible combinations of the digits, including borrowed digits. With the number subtracted from being a number in binary and the number that is subtracted being a number in ternary, we can get the digits 0, 1, 7, 8, and 9 (with borrowing), and no other digits.
LINKS
FORMULA
a(n) = A007088(n) - A007089(n).
EXAMPLE
a(7) = 111 (7 in binary) - 21 (7 in ternary) = 90.
MATHEMATICA
Array[Subtract @@ Map[FromDigits, IntegerDigits[#, {2, 3}]] &, 44] (* Michael De Vlieger, Aug 18 2021 *)
PROG
(PARI) a(n) = fromdigits(digits(n, 2)) - fromdigits(digits(n, 3)); \\ Michel Marcus, Aug 19 2021
CROSSREFS
Sequence in context: A051379 A143499 A114152 * A254933 A174503 A048786
KEYWORD
base,nonn
AUTHOR
Atticus Stewart, Aug 17 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 April 28 14:15 EDT 2024. Contains 372087 sequences. (Running on oeis4.)