login
A356248
Image of 1 under repeated application of the map k -> (2k-1,2k,2k-1).
0
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, 9, 10, 9, 11, 12, 11, 9, 10, 9, 13, 14, 13, 15, 16, 15, 13, 14, 13, 9, 10, 9, 11, 12, 11, 9, 10, 9, 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
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
Cf. A289813.
Sequence in context: A105646 A059126 A059128 * A050273 A182511 A187064
KEYWORD
nonn
AUTHOR
Arie Bos, Jul 31 2022
STATUS
approved