OFFSET
1,3
COMMENTS
This sequence is to balanced ternary what A328727 is to ternary.
FORMULA
A350775(n) = 0 iff n belongs to the present sequence.
EXAMPLE
The first terms, in decimal and in balanced ternary, are:
n a(n) bter(n)
-- ---- -------
1 0 0
2 1 1
3 3 10
4 8 10T
5 9 100
6 10 101
7 24 10T0
8 26 100T
9 27 1000
10 28 1001
11 30 1010
12 71 10T0T
PROG
(PARI) is(n) = { my (p=0, d); while (n, d=[0, 1, -1][1+n%3]; if (p && d, return (0), n=(n-d)/3; p=d)); 1 }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 15 2022
STATUS
approved