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.

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

This page as a plain text file.
%I A353828 #10 May 10 2022 02:26:27
%S A353828 0,1,2,3,4,7,6,5,8,9,10,11,12,13,20,21,22,19,18,17,16,15,14,25,24,23,
%T A353828 26,27,28,29,30,31,34,33,32,35,36,37,38,39,40,61,60,59,62,63,64,65,66,
%U A353828 67,56,57,58,55,54,53,52,51,50,47,48,49,46,45,44,43,42,41
%N A353828 The positions of nonzero digits in the balanced ternary expansions of n and a(n) are the same, and the k-th leftmost nonzero digit in a(n) equals the product of the k leftmost nonzero digits in n.
%C A353828 This sequence is a permutation of the nonnegative integers with inverse A353829.
%C A353828 A number is a fixed point of this sequence iff it has at most one digit -1 in its balanced ternary expansion, that digit -1 being its rightmost nonzero digit.
%H A353828 Rémy Sigrist, <a href="/A353828/b353828.txt">Table of n, a(n) for n = 0..6561</a>
%H A353828 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A353828 a(3*n) = 3*a(n).
%e A353828 The first terms, in decimal and in balanced ternary, are:
%e A353828   n   a(n)  bter(n)  bter(a(n))
%e A353828   --  ----  -------  ----------
%e A353828    0     0        0           0
%e A353828    1     1        1           1
%e A353828    2     2       1T          1T
%e A353828    3     3       10          10
%e A353828    4     4       11          11
%e A353828    5     7      1TT         1T1
%e A353828    6     6      1T0         1T0
%e A353828    7     5      1T1         1TT
%e A353828    8     8      10T         10T
%e A353828    9     9      100         100
%e A353828   10    10      101         101
%e A353828   11    11      11T         11T
%e A353828   12    12      110         110
%o A353828 (PARI) a(n) = {
%o A353828     my (d=[], t, p=1);
%o A353828     while (n, d=concat(t=[0,1,-1][1+n%3], d); n=(n-t)/3);
%o A353828     for (k=1, #d, if (d[k], d[k]=p*=d[k]));
%o A353828     fromdigits(d,3);
%o A353828 }
%Y A353828 See A305458, A353824, A353826, A353830 for similar sequences.
%Y A353828 Cf. A353829 (inverse).
%K A353828 nonn,base
%O A353828 0,3
%A A353828 _Rémy Sigrist_, May 08 2022