This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A381618 #8 Mar 03 2025 09:33:24 %S A381618 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, %T A381618 51,45,38,29,25,46,32,33,54,53,41,50,28,49,40,36,42,23,44,27,31,52,48, %U A381618 39,37,26,47,35,34,55,56,111,58,77,132,113,98,63,64,119,79 %N A381618 Reverse the Chung-Graham representation of n while preserving its trailing zeros: a(n) = A381607(A263273(A381608(n))). %C A381618 This sequence is a self-inverse permutation of the nonnegative integers. %H A381618 Rémy Sigrist, <a href="/A381618/b381618.txt">Table of n, a(n) for n = 0..6765</a> %H A381618 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A381618 a(n) <= A000045(2*k) iff n <= A000045(2*k). %e A381618 The first terms, alongside their Chung-Graham representation, are: %e A381618 n a(n) A381579(n) A381579(a(n)) %e A381618 -- ---- ---------- ------------- %e A381618 0 0 0 0 %e A381618 1 1 1 1 %e A381618 2 2 2 2 %e A381618 3 3 10 10 %e A381618 4 4 11 11 %e A381618 5 7 12 21 %e A381618 6 6 20 20 %e A381618 7 5 21 12 %e A381618 8 8 100 100 %e A381618 9 9 101 101 %e A381618 10 17 102 201 %e A381618 11 11 110 110 %e A381618 12 12 111 111 %e A381618 13 20 112 211 %e A381618 14 19 120 210 %e A381618 15 15 121 121 %e A381618 16 16 200 200 %o A381618 (PARI) A381607(n) = { my (t = Vecrev(digits(n, 3))); sum(k = 1, #t, t[k] * fibonacci(2*k)); } %o A381618 A263273(n) = { my (t = 3^if (n, valuation(n, 3), 0)); t * fromdigits(Vecrev(digits(n / t, 3)), 3) } %o A381618 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););); } %o A381618 a(n) = A381607(A263273(A381608(n))) %Y A381618 See A345201 for a similar sequence. %Y A381618 Cf. A000045, A263273, A381579, A381607, A381608. %K A381618 nonn,base %O A381618 0,3 %A A381618 _Rémy Sigrist_, Mar 02 2025