login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A347411
Sqrt(3)+1-adic expansion of 4, in balanced ternary alphabet.
2
0, 0, 0, 0, 1, 0, 1, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 1, 0, 1, -1, 1, -1, 0, -1, 0, -1, 1, -1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, -1, 1, 0, 0, -1, 0, 0, 0, 0, 0, -1, 1, -1, 1, -1, 1, 0, 0, -1, 1, 0, 1, 0, 1, 0, 0, -1, 1, -1, 1, -1, 1, -1, 0, -1, 1, -1, 0, -1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, -1, 1, 0, 1, 0, 0, -1, 1, -1, 0, 0, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, -1, 0, 0, 0, -1, 1, 0, 1, 0, 1, 0, 0, 0, 0, -1, 0, 0, 1, -1, 1, -1, 1, -1, 0, 0, 1, -1, 1, -1, 1, 0, 1, -1, 1, 0, 0, -1, 1, 0, 1, -1, 1, -1, 1, 0, 1, 0, 0, -1, 0, 0, 1, 0, 0, -1, 1, -1, 0, -1, 0, 0, 1, 0, 0, 0, 0, -1, 1, 0
OFFSET
0
COMMENTS
Starting with the number 4, repeatedly "carry" into higher terms of the sequence by scaling and shifting the sequence (-2, -2, 1). For odd numbers, retain sign by scaling the carry by half its magnitude, rounded toward 0. See examples for iterates.
Also appears to work with initial sequences [2, 0, 1, -1, 1, -1, ...] (repeating 1 and -1), [0, 0, 2, -2, 2, -2] (repeating 2 and -2), and [0, 0, 0, 0, 1, -2, 3, -4] (alternating naturals).
Sequence name is by analogy with p-adic numbers and due to the carry sequence (-2, -2, 1) corresponding to the polynomial x^2 - 2x - 2, which has root sqrt(3)+1.
1 only occurs at even positions, -1 occurs only at odd positions.
First 8192 digits appear to be aperiodic.
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, 33, -12;
In the limit, this produces the sequence above.
PROG
(Haskell)
a347411_iterates = iterate (doubleBorrow []) (4:repeat 0) where
doubleBorrow zs (x:y:z:xs)
| 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)
a347411 n = (a347411_iterates !! (n+1)) !! n
CROSSREFS
Sequence in context: A333189 A011662 A011665 * A059437 A152592 A347412
KEYWORD
sign,base
AUTHOR
Ben Conner, Aug 30 2021
STATUS
approved