login
A347412
Sqrt(3)+1-adic expansion of 4, in binary alphabet
1
0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0
OFFSET
0
COMMENTS
Similarly to A347411, start with the number 4, and repeatedly "carry" into higher terms of the sequence by scaling and shifting the sequence (-2, -2, 1). For negative odd numbers, carry past 0 so that the result of the carry is 1.
EXAMPLE
First few iterates of carry, starting from expansion "4":
4
0, -4, 2
0, 0, 6, -2
0, 0, 0, -8, 3
0, 0, 0, 0, 11, 4
0, 0, 0, 0, 1, -14, 5
0, 0, 0, 0, 1, 0, 19, -7
0, 0, 0, 0, 1, 0, 1, -25, 9
0, 0, 0, 0, 1, 0, 1, 1, 35, -13
PROG
(Haskell)
a347412_iterates = iterate (doubleBorrow []) (4:repeat 0) where
doubleBorrow zs (x:y:z:xs)
| odd x && x <= -2 = let (q, r) = quotRem x 2 in foldl (flip (:)) (r + 2 : y-x+r+2 : z+q-1 : xs) zs
| abs x >= 2 = let (q, r) = quotRem x 2 in foldl (flip (:)) (r : y-x+r : z+q : xs) zs
| otherwise = doubleBorrow (x:zs) (y:z:xs)
a347412 n = (a347412_iterates !! (n+1)) !! n
CROSSREFS
Sequence in context: A347411 A059437 A152592 * A275926 A131533 A131532
KEYWORD
nonn,base
AUTHOR
Ben Conner, Aug 30 2021
EXTENSIONS
Extra-long data section is OK for now. - N. J. A. Sloane, Oct 25 2021
STATUS
approved