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.

A338828 For any number with ternary representation (t(1), t(2), ..., t(k)), the ternary representation of a(n) is (abs(t(1)-t(k)), abs(t(2)-t(k-1)), ..., abs(t(k)-t(1))).

Original entry on oeis.org

0, 0, 0, 4, 0, 4, 8, 4, 0, 10, 0, 10, 10, 0, 10, 10, 0, 10, 20, 10, 0, 20, 10, 0, 20, 10, 0, 28, 0, 28, 40, 12, 40, 52, 24, 52, 40, 12, 40, 28, 0, 28, 40, 12, 40, 52, 24, 52, 40, 12, 40, 28, 0, 28, 56, 28, 0, 68, 40, 12, 80, 52, 24, 68, 40, 12, 56, 28, 0, 68
Offset: 0

Views

Author

Rémy Sigrist, Nov 11 2020

Keywords

Comments

Leading zeros are ignored.

Crossrefs

Cf. A014190, A175919 (binary analog), A338827 (decimal analog).

Programs

  • Maple
    a:= n-> (l-> (h-> add(h[j]*3^(j-1), j=1..nops(h)))([seq(
        abs(l[i]-l[-i]), i=1..nops(l))]))(convert(n, base, 3)):
    seq(a(n), n=0..70);  # Alois P. Heinz, Nov 12 2020
  • PARI
    a(n, base=3) = my (d=digits(n, base)); fromdigits(abs(d-Vecrev(d)), base)

Formula

a(n) = 0 iff n is a palindrome in base 3 (A014190).
Showing 1-1 of 1 results.