A060587 A ternary code: inverse of A060583.
0, 2, 1, 8, 7, 6, 4, 3, 5, 24, 26, 25, 23, 22, 21, 19, 18, 20, 12, 14, 13, 11, 10, 9, 16, 15, 17, 72, 74, 73, 80, 79, 78, 76, 75, 77, 69, 71, 70, 68, 67, 66, 64, 63, 65, 57, 59, 58, 56, 55, 54, 61, 60, 62, 36, 38, 37, 44, 43, 42, 40, 39, 41, 33, 35, 34, 32, 31, 30, 28, 27, 29
Offset: 0
Examples
a(76) = 46 since 76 written in base 3 is 2211; this gives a first digit of 1( = 3-2-0), a second digit of 2( = 2 = 2), a third digit of 0( = 3-1-2) and a fourth digit of 1( = 1 = 1); 1201 base 3 is 46.
Links
Formula
a(n) = 3a([n/3])+(-[n/3]-n mod 3) = 3a([n/3]) + A060588(n).
Comments