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.

A362089 The base-3 expansion of a(n) is obtained by inserting a zero before each nonzero digit of the base-3 expansion of n.

This page as a plain text file.
%I A362089 #15 Apr 13 2023 08:30:07
%S A362089 0,1,2,3,10,11,6,19,20,9,28,29,30,91,92,33,100,101,18,55,56,57,172,
%T A362089 173,60,181,182,27,82,83,84,253,254,87,262,263,90,271,272,273,820,821,
%U A362089 276,829,830,99,298,299,300,901,902,303,910,911,54,163,164,165,496
%N A362089 The base-3 expansion of a(n) is obtained by inserting a zero before each nonzero digit of the base-3 expansion of n.
%C A362089 This sequence is a permutation of A328727.
%e A362089 The first terms, in decimal and in base-3, are:
%e A362089   n   a(n)  ter(n)  ter(a(n))
%e A362089   --  ----  ------  ---------
%e A362089    0     0       0          0
%e A362089    1     1       1          1
%e A362089    2     2       2          2
%e A362089    3     3      10         10
%e A362089    4    10      11        101
%e A362089    5    11      12        102
%e A362089    6     6      20         20
%e A362089    7    19      21        201
%e A362089    8    20      22        202
%e A362089    9     9     100        100
%e A362089   10    28     101       1001
%e A362089   11    29     102       1002
%e A362089   12    30     110       1010
%o A362089 (PARI) a(n) = { if (n==0, 0, n%3, 9*a(n\3) + n%3, 3*a(n/3)); }
%o A362089 (Python)
%o A362089 from gmpy2 import digits
%o A362089 def A362089(n): return int(digits(n,3).replace('1','01').replace('2','02'),3)
%o A362089 # _Chai Wah Wu_, Apr 12 2023
%Y A362089 Cf. A007089 (ter(n)), A048678, A328727, A362090.
%K A362089 nonn,base
%O A362089 0,3
%A A362089 _Rémy Sigrist_, Apr 08 2023