%I #15 Jan 24 2022 17:07:49
%S 0,1,2,3,6,9,10,11,18,19,20,27,28,29,30,33,54,55,56,57,60,81,82,83,84,
%T 87,90,91,92,99,100,101,162,163,164,165,168,171,172,173,180,181,182,
%U 243,244,245,246,249,252,253,254,261,262,263,270,271,272,273,276
%N Nonnegative numbers whose base-3 expansion has no two consecutive nonzero digits.
%C This sequence is a ternary variant of A003714, the fibbinary numbers.
%C Apparently, A122983 gives the distinct values of the first differences of this sequence.
%H Rémy Sigrist, <a href="/A328727/b328727.txt">Table of n, a(n) for n = 1..10923</a> (Terms < 3^13)
%e The first terms, alongside their ternary representation, are:
%e n a(n) ter(a(n))
%e -- ---- ---------
%e 1 0 0
%e 2 1 1
%e 3 2 2
%e 4 3 10
%e 5 6 20
%e 6 9 100
%e 7 10 101
%e 8 11 102
%e 9 18 200
%e 10 19 201
%e 11 20 202
%e 12 27 1000
%o (PARI) is(n, base=3) = my (d=digits(n, base)); for (i=1, #d-1, if (d[i] && d[i+1], return (0))); return (1)
%o (Python)
%o from itertools import count, islice
%o from gmpy2 import digits
%o def A328727_gen(startvalue=0): # generator of terms >= startvalue
%o for n in count(max(startvalue,0)):
%o s = digits(n,3)
%o for i in range(len(s)-1):
%o if '0' not in s[i:i+2]:
%o break
%o else:
%o yield n
%o A328727_list = list(islice(A328727_gen(),30)) # _Chai Wah Wu_, Jan 24 2022
%Y Cf. A003714, A122983.
%K nonn,base,easy
%O 1,3
%A _Rémy Sigrist_, Oct 26 2019