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.

A353829 Inverse permutation to A353828.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 5, 8, 9, 10, 11, 12, 13, 22, 21, 20, 19, 18, 17, 14, 15, 16, 25, 24, 23, 26, 27, 28, 29, 30, 31, 34, 33, 32, 35, 36, 37, 38, 39, 40, 67, 66, 65, 64, 63, 62, 59, 60, 61, 58, 57, 56, 55, 54, 53, 50, 51, 52, 43, 42, 41, 44, 45, 46, 47, 48, 49
Offset: 0

Views

Author

Rémy Sigrist, May 08 2022

Keywords

Examples

			A353828(7) = 5, so a(5) = 7.
		

Crossrefs

Cf. A353828.

Programs

  • PARI
    a(n) = {
        my (d=[], t, p=1);
        while (n, d=concat(t=[0, 1, -1][1+n%3], d); n=(n-t)/3);
        for (k=1, #d, if (d[k], p*=d[k]=p*d[k]));
        fromdigits(d, 3);
    }