OFFSET
1,3
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10923 (Terms < 3^13)
EXAMPLE
The first terms, alongside their ternary representation, are:
n a(n) ter(a(n))
-- ---- ---------
1 0 0
2 1 1
3 2 2
4 3 10
5 6 20
6 9 100
7 10 101
8 11 102
9 18 200
10 19 201
11 20 202
12 27 1000
PROG
(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)
(Python)
from itertools import count, islice
from gmpy2 import digits
def A328727_gen(startvalue=0): # generator of terms >= startvalue
for n in count(max(startvalue, 0)):
s = digits(n, 3)
for i in range(len(s)-1):
if '0' not in s[i:i+2]:
break
else:
yield n
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Oct 26 2019
STATUS
approved