login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
2
0, 1, 2, 3, 10, 11, 6, 19, 20, 9, 28, 29, 30, 91, 92, 33, 100, 101, 18, 55, 56, 57, 172, 173, 60, 181, 182, 27, 82, 83, 84, 253, 254, 87, 262, 263, 90, 271, 272, 273, 820, 821, 276, 829, 830, 99, 298, 299, 300, 901, 902, 303, 910, 911, 54, 163, 164, 165, 496
OFFSET
0,3
COMMENTS
This sequence is a permutation of A328727.
EXAMPLE
The first terms, in decimal and in base-3, are:
n a(n) ter(n) ter(a(n))
-- ---- ------ ---------
0 0 0 0
1 1 1 1
2 2 2 2
3 3 10 10
4 10 11 101
5 11 12 102
6 6 20 20
7 19 21 201
8 20 22 202
9 9 100 100
10 28 101 1001
11 29 102 1002
12 30 110 1010
PROG
(PARI) a(n) = { if (n==0, 0, n%3, 9*a(n\3) + n%3, 3*a(n/3)); }
(Python)
from gmpy2 import digits
def A362089(n): return int(digits(n, 3).replace('1', '01').replace('2', '02'), 3)
# Chai Wah Wu, Apr 12 2023
CROSSREFS
Cf. A007089 (ter(n)), A048678, A328727, A362090.
Sequence in context: A351413 A283436 A225558 * A301382 A288657 A055655
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 08 2023
STATUS
approved