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.

A353830 The positions of nonzero digits in the balanced ternary expansions of n and a(n) are the same, and the k-th rightmost nonzero digit in a(n) equals the product of the k rightmost nonzero digits in n.

This page as a plain text file.
%I A353830 #10 May 10 2022 02:26:13
%S A353830 0,1,-4,3,4,11,-12,-11,-10,9,10,-13,12,13,-34,33,34,35,-36,-35,32,-33,
%T A353830 -32,29,-30,-29,-28,27,28,-31,30,31,38,-39,-38,-37,36,37,-40,39,40,
%U A353830 101,-102,-101,-100,99,100,-103,102,103,-106,105,106,107,-108,-107,104
%N A353830 The positions of nonzero digits in the balanced ternary expansions of n and a(n) are the same, and the k-th rightmost nonzero digit in a(n) equals the product of the k rightmost nonzero digits in n.
%C A353830 This sequence can naturally be extended to negative integers; we then obtain a permutation of the integers (Z).
%C A353830 A number is a fixed point of this sequence iff it has no digit -1 in its balanced ternary expansion (A005836).
%H A353830 Rémy Sigrist, <a href="/A353830/b353830.txt">Table of n, a(n) for n = 0..6561</a>
%F A353830 a(3*n) = 3*a(n).
%F A353830 a(3*n + 1) = 3*a(n) + 1.
%F A353830 Sum_{k = 0..n} a(n) = 0 iff n belongs to A029858.
%e A353830 The first terms, in decimal and in balanced ternary, are:
%e A353830   n   a(n)  bter(n)  bter(a(n))
%e A353830   --  ----  -------  ----------
%e A353830    0     0        0           0
%e A353830    1     1        1           1
%e A353830    2    -4       1T          TT
%e A353830    3     3       10          10
%e A353830    4     4       11          11
%e A353830    5    11      1TT         11T
%e A353830    6   -12      1T0         TT0
%e A353830    7   -11      1T1         TT1
%e A353830    8   -10      10T         T0T
%e A353830    9     9      100         100
%e A353830   10    10      101         101
%e A353830   11   -13      11T         TTT
%e A353830   12    12      110         110
%o A353830 (PARI) a(n) = {
%o A353830         my (d=[], t, p=1);
%o A353830         while (n, d=concat(t=[0,1,-1][1+n%3], d); n=(n-t)/3);
%o A353830         forstep (k=#d, 1, -1, if (d[k], d[k]=p*=d[k]));
%o A353830         fromdigits(d,3);
%o A353830 }
%Y A353830 See A305458, A353824, A353826, A353828 for similar sequences.
%Y A353830 Cf. A005836 (fixed points), A029858, A153775.
%K A353830 sign,base
%O A353830 0,3
%A A353830 _Rémy Sigrist_, May 08 2022