[go: up one dir, main page]

login
Search: a353649 -id:a353649
     Sort: relevance | references | number | modified | created      Format: long | short | data
Inverse permutation to A353649.
+20
2
0, 1, 2, 4, 6, 5, 3, 13, 7, 9, 11, 15, 17, 20, 10, 8, 16, 12, 14, 18, 37, 39, 41, 21, 23, 25, 31, 27, 29, 33, 35, 43, 46, 48, 54, 50, 52, 56, 60, 58, 63, 28, 30, 32, 24, 22, 34, 26, 47, 49, 19, 36, 38, 40, 42, 51, 53, 55, 104, 44, 112, 114, 108, 106, 116, 110
OFFSET
0,3
EXAMPLE
A353649(7) = 8 so a(8) = 7.
PROG
(PARI) See Links section.
CROSSREFS
Cf. A353649.
KEYWORD
nonn,look,base
AUTHOR
Rémy Sigrist, May 01 2022
STATUS
approved
Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, n and a(n) can be added without carries in balanced ternary.
+10
2
0, 2, 1, 5, 6, 3, 4, 17, 15, 14, 18, 16, 19, 23, 9, 8, 11, 7, 10, 12, 51, 50, 53, 13, 44, 45, 42, 41, 47, 43, 46, 54, 48, 49, 56, 52, 55, 57, 69, 68, 71, 27, 26, 29, 24, 25, 30, 28, 32, 33, 21, 20, 35, 22, 31, 36, 34, 37, 149, 153, 152, 155, 150, 151, 156, 154
OFFSET
0,2
COMMENTS
Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.
This sequence is a self-inverse permutation of the nonnegative integers with a single fixed point: a(0) = 0.
EXAMPLE
The first terms, in decimal and in balanced ternary, are:
n | 0 1 2 3 4 5 6 7 8 9 10 11 12
a(n) | 0 2 1 5 6 3 4 17 15 14 18 16 19
bter(n) | 0 1 1T 10 11 1TT 1T0 1T1 10T 100 101 11T 110
bter(a(n))| 0 1T 1 1TT 1T0 10 11 1T0T 1TT0 1TTT 1T00 1TT1 1T01
PROG
(PARI) ok(u, v) = { while (u && v, my (uu=[0, +1, -1][1+u%3], vv=[0, +1, -1][1+v%3]); if (abs(uu+vv)>1, return (0)); u=(u-uu)/3; v=(v-vv)/3); 1 }
{ s=0; for (n=0, 65, for (v=0, oo, if (!bittest(s, v) && ok(n, v), print1 (v", "); s+=2^v; break))) }
CROSSREFS
Cf. A059095, A238757 (binary analog), A353649.
KEYWORD
nonn,look,base
AUTHOR
Rémy Sigrist, May 01 2022
STATUS
approved

Search completed in 0.005 seconds