cp's OEIS Frontend

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.

A381668 Ternary modular Gray code for n written in base 3.

This page as a plain text file.
%I A381668 #18 Mar 12 2025 07:47:31
%S A381668 0,1,2,12,10,11,21,22,20,120,121,122,102,100,101,111,112,110,210,211,
%T A381668 212,222,220,221,201,202,200,1200,1201,1202,1212,1210,1211,1221,1222,
%U A381668 1220,1020,1021,1022,1002,1000,1001,1011,1012,1010,1110,1111,1112,1122,1120,1121
%N A381668 Ternary modular Gray code for n written in base 3.
%C A381668 Similar to binary Gray code in that a(n) differs from a(n+1) by one digit, including the last number with a given number of digits compared to a(0).
%F A381668 a(n) = A007089(A105530(n)).
%o A381668 (PARI) a(n) = my(v=digits(n, 3)); forstep(i=#v, 2, -1, v[i]=(v[i]-v[i-1])%3); fromdigits(v, 10); \\ (after A105530) - _Andrew Howroyd_, Mar 03 2025
%Y A381668 Cf. A007089, A105530.
%K A381668 nonn,base,easy
%O A381668 0,3
%A A381668 _Joshua Chester_, Mar 03 2025