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 A361832 #14 Mar 30 2024 11:38:34 %S A361832 0,1,2,5,4,3,7,6,8,16,17,15,12,13,14,11,9,10,23,21,22,19,20,18,24,25, %T A361832 26,50,49,48,53,52,51,47,46,45,38,37,36,41,40,39,44,43,42,35,34,33,29, %U A361832 28,27,32,31,30,70,69,71,64,63,65,67,66,68,58,57,59,61,60 %N A361832 For any number k >= 0, let T_k be the triangle whose base corresponds to the ternary expansion of k (without leading zeros) and other values, say t above u and v, satisfy t = (-u-v) mod 3; the ternary expansion of a(n) corresponds to the left border of T_n (the most significant digit being at the bottom left corner). %C A361832 This sequence is a variant of A334727. %C A361832 This sequence is a self-inverse permutation of the nonnegative integers that preserves the number of digits and the leading digit in base 3. %H A361832 Rémy Sigrist, <a href="/A361832/b361832.txt">Table of n, a(n) for n = 0..6560</a> %H A361832 <a href="/index/X#XOR-triangles">Index entries for sequences related to XOR-triangles</a> %H A361832 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A361832 a(floor(n/3)) = floor(a(n)/3). %F A361832 a(A004488(n)) = A004488(a(n)). %F A361832 a(n) = n for any n in A048328. %F A361832 a(n) = n iff b belongs to A361833. %e A361832 For n = 42: the ternary expansion of 42 is "1120" and the corresponding triangle is as follows: %e A361832 2 %e A361832 2 2 %e A361832 1 0 1 %e A361832 1 1 2 0 %e A361832 So the ternary expansion of a(42) is "1122", and a(42) = 44. %o A361832 (PARI) a(n) = { my (d = digits(n, 3), t = vector(#d)); for (k = 1, #d, t[k] = d[1]; d = vector(#d-1, i, (-d[i]-d[i+1]) % 3);); fromdigits(t, 3); } %Y A361832 Cf. A004488, A048328, A334727, A361818, A361833 (fixed points). %K A361832 nonn,base %O A361832 0,3 %A A361832 _Rémy Sigrist_, Mar 26 2023