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 A105529 #23 Jun 26 2023 08:48:01 %S A105529 0,1,2,4,5,3,8,6,7,13,14,12,17,15,16,9,10,11,26,24,25,18,19,20,22,23, %T A105529 21,40,41,39,44,42,43,36,37,38,53,51,52,45,46,47,49,50,48,27,28,29,31, %U A105529 32,30,35,33,34,80,78,79,72,73,74,76,77,75 %N A105529 Given a list of ternary numbers, interpret each as a ternary modular Gray code number, then convert to decimal. %H A105529 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %e A105529 a(9) = 13 since Ternary 100 (9 decimal) interpreted as Ternary Gray code = 13. %t A105529 a[n_] := Module[{v = IntegerDigits[n, 3]}, Do[v[[i]] = Mod[v[[i]]+v[[i-1]], 3], {i, 2, Length[v]}]; FromDigits[v, 3]]; %t A105529 Table[a[n], {n, 0, 62}] (* _Jean-François Alcover_, Jun 26 2023, after _Kevin Ryde_ *) %o A105529 (PARI) a(n) = my(v=digits(n,3)); for(i=2,#v, v[i]=(v[i]+v[i-1])%3); fromdigits(v,3); \\ _Kevin Ryde_, May 23 2020 %Y A105529 Cf. A105530 (inverse), A128173 (ternary reflected), A006068 (binary), A226134 (decimal modular), A007089. %K A105529 nonn,easy %O A105529 0,3 %A A105529 _Gary W. Adamson_, Apr 11 2005 %E A105529 More terms from _Sean A. Irvine_, Feb 09 2012 %E A105529 Comments by Gary W. Adamson moved to A105530 where they better apply. - _Kevin Ryde_, May 30 2020