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 A060587 #13 Mar 23 2020 09:45:39 %S A060587 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, %T A060587 17,72,74,73,80,79,78,76,75,77,69,71,70,68,67,66,64,63,65,57,59,58,56, %U A060587 55,54,61,60,62,36,38,37,44,43,42,40,39,41,33,35,34,32,31,30,28,27,29 %N A060587 A ternary code: inverse of A060583. %C A060587 Write n in base 3, then (working from left to right) if the k-th digit of n is equal to the digit to the left of it then this is the k-th digit of a(n), otherwise the k-th digit of a(n) is the element of {0,1,2} which has not just been compared, then read result as a base 3 number. %H A060587 Alois P. Heinz, <a href="/A060587/b060587.txt">Table of n, a(n) for n = 0..6560</a> %H A060587 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A060587 a(n) = 3a([n/3])+(-[n/3]-n mod 3) = 3a([n/3]) + A060588(n). %F A060587 a(n) = A253586(n,floor(n/3)) = A253587(n,floor(n/3)). - _Alois P. Heinz_, Jan 09 2015 %e A060587 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. %Y A060587 Cf. A060583, A060588, A253586, A253587. %K A060587 base,nonn %O A060587 0,2 %A A060587 _Henry Bottomley_, Apr 04 2001