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.

Showing 1-1 of 1 results.

A300956 a(0) = 0, a(1) = 2, a(2) = 1, and for any n > 2 with ternary representation n = Sum_{i=0..k} t_i * 3^i, a(n) = Sum_{i=0..k} a(t_i) * 3^a(i).

Original entry on oeis.org

0, 2, 1, 18, 20, 19, 9, 11, 10, 6, 8, 7, 24, 26, 25, 15, 17, 16, 3, 5, 4, 21, 23, 22, 12, 14, 13, 774840978, 774840980, 774840979, 774840996, 774840998, 774840997, 774840987, 774840989, 774840988, 774840984, 774840986, 774840985, 774841002, 774841004
Offset: 0

Views

Author

Rémy Sigrist, Mar 17 2018

Keywords

Comments

This sequence is a self-inverse permutation of the natural numbers.
This sequence has connections with A300955.
This sequence has infinitely many fixed points (A300958); for any k >= 0, at least one of k or 3^k + 2 * 3^a(k) is a fixed point.

Crossrefs

Cf. A160384, A300955, A300958 (fixed points).

Programs

  • PARI
    a(n) = my (t=Vecrev(digits(n,3))); sum(i=0, #t-1, if (t[i+1]==1, 2, t[i+1]==2, 1, 0) * 3 ^ a(i))

Formula

A160384(a(n)) = A160384(n).
a(a(n)) = n.
Showing 1-1 of 1 results.