OFFSET
0,2
FORMULA
If A(n) = (a(0),a(1),...,a(3^n-1)), then A(n+1) = (A(n),2^n+A(n),A(n)).
a(n) = A289813(n) + 1. - Rémy Sigrist, Jul 31 2022
EXAMPLE
1 --> 1 2 1 --> 1 2 1 3 4 3 1 2 1 --> 1 2 1 3 4 3 1 2 1 5 6 5 7 8 7 5 6 5 1 2 1 3 4 3 1 2 1 -->...
PROG
(Python)
def aupton(terms):
a, n = [1], 0
while len(a) < 3*terms: a, n = a + [(1<<n) + ai for ai in a] + a, n+1
return a[:terms]
print(aupton(81)) # Michael S. Branicky, Jul 31 2022
(PARI) a(n) = fromdigits(digits(n, 3)%2, 2) + 1; \\ Kevin Ryde, Jul 31 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Arie Bos, Jul 31 2022
STATUS
approved