login
A381618
Reverse the Chung-Graham representation of n while preserving its trailing zeros: a(n) = A381607(A263273(A381608(n))).
1
0, 1, 2, 3, 4, 7, 6, 5, 8, 9, 17, 11, 12, 20, 19, 15, 16, 10, 18, 14, 13, 21, 22, 43, 24, 30, 51, 45, 38, 29, 25, 46, 32, 33, 54, 53, 41, 50, 28, 49, 40, 36, 42, 23, 44, 27, 31, 52, 48, 39, 37, 26, 47, 35, 34, 55, 56, 111, 58, 77, 132, 113, 98, 63, 64, 119, 79
OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
FORMULA
a(n) <= A000045(2*k) iff n <= A000045(2*k).
EXAMPLE
The first terms, alongside their Chung-Graham representation, are:
n a(n) A381579(n) A381579(a(n))
-- ---- ---------- -------------
0 0 0 0
1 1 1 1
2 2 2 2
3 3 10 10
4 4 11 11
5 7 12 21
6 6 20 20
7 5 21 12
8 8 100 100
9 9 101 101
10 17 102 201
11 11 110 110
12 12 111 111
13 20 112 211
14 19 120 210
15 15 121 121
16 16 200 200
PROG
(PARI) A381607(n) = { my (t = Vecrev(digits(n, 3))); sum(k = 1, #t, t[k] * fibonacci(2*k)); }
A263273(n) = { my (t = 3^if (n, valuation(n, 3), 0)); t * fromdigits(Vecrev(digits(n / t, 3)), 3) }
A381608(n) = { for (k = 1, oo, my (f = fibonacci(2*k)); if (f >= n, my (v = 0); while (n, while (n >= f, n -= f; v += 3^(k-1); ); f = fibonacci(2*k--); ); return (v); ); ); }
a(n) = A381607(A263273(A381608(n)))
CROSSREFS
See A345201 for a similar sequence.
Sequence in context: A270426 A270425 A332212 * A085161 A085162 A182178
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 02 2025
STATUS
approved