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.

User: Joshua Chester

Joshua Chester's wiki page.

Joshua Chester has authored 1 sequences.

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

Original entry on oeis.org

0, 1, 2, 12, 10, 11, 21, 22, 20, 120, 121, 122, 102, 100, 101, 111, 112, 110, 210, 211, 212, 222, 220, 221, 201, 202, 200, 1200, 1201, 1202, 1212, 1210, 1211, 1221, 1222, 1220, 1020, 1021, 1022, 1002, 1000, 1001, 1011, 1012, 1010, 1110, 1111, 1112, 1122, 1120, 1121
Offset: 0

Author

Joshua Chester, Mar 03 2025

Keywords

Comments

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).

Crossrefs

Programs

  • 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

Formula

a(n) = A007089(A105530(n)).