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.

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

This page as a plain text file.
%I A338828 #13 Nov 12 2020 11:50:22
%S A338828 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,
%T A338828 0,28,40,12,40,52,24,52,40,12,40,28,0,28,40,12,40,52,24,52,40,12,40,
%U A338828 28,0,28,56,28,0,68,40,12,80,52,24,68,40,12,56,28,0,68
%N 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))).
%C A338828 Leading zeros are ignored.
%H A338828 Rémy Sigrist, <a href="/A338828/b338828.txt">Table of n, a(n) for n = 0..6561</a>
%F A338828 a(n) = 0 iff n is a palindrome in base 3 (A014190).
%p A338828 a:= n-> (l-> (h-> add(h[j]*3^(j-1), j=1..nops(h)))([seq(
%p A338828     abs(l[i]-l[-i]), i=1..nops(l))]))(convert(n, base, 3)):
%p A338828 seq(a(n), n=0..70);  # _Alois P. Heinz_, Nov 12 2020
%o A338828 (PARI) a(n, base=3) = my (d=digits(n, base)); fromdigits(abs(d-Vecrev(d)), base)
%Y A338828 Cf. A014190, A175919 (binary analog), A338827 (decimal analog).
%K A338828 nonn,base,look
%O A338828 0,4
%A A338828 _Rémy Sigrist_, Nov 11 2020