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!)
A361946 If the base-4 expansion of n starts with the digit 1, then replace 2's by 3's and vice versa; if it starts with the digit 2, then replace 1's by 3's and vice versa; if it starts with the digit 3, then replace 1's by 2's and vice versa; a(0) = 0. 2
0, 1, 2, 3, 4, 5, 7, 6, 8, 11, 10, 9, 12, 14, 13, 15, 16, 17, 19, 18, 20, 21, 23, 22, 28, 29, 31, 30, 24, 25, 27, 26, 32, 35, 34, 33, 44, 47, 46, 45, 40, 43, 42, 41, 36, 39, 38, 37, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63, 64, 65, 67, 66 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
LINKS
FORMULA
a(n) = A163241(n) when A122587(n) = 1.
a(n) = A048647(n) when A122587(n) = 2.
a(n) = A057300(n) when A122587(n) = 3.
a(n) = n iff n = d * A000695(k) for some d in {1, 2, 3} and some k >= 0.
EXAMPLE
For n = 539:
- the base-4 expansion of 539 is "20123",
- it starts with the digit 2, so we replace 1's by 3's and vice versa,
- so the base-4 expansion of a(539) is "20321", and a(539) = 569.
PROG
(PARI) a(n) = { my (q = digits(n, 4), m = if (#q, [ [0, 1, 3, 2], [0, 3, 2, 1], [0, 2, 1, 3] ][q[1]], [0, 1, 2, 3])); fromdigits(apply (d -> m[1+d], q), 4); }
CROSSREFS
Sequence in context: A091995 A343150 A338698 * A066937 A217266 A347539
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 01 2023
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 July 24 05:58 EDT 2024. Contains 374575 sequences. (Running on oeis4.)