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”).

A335933
A fractal function, related to ruler functions. a(1) = 0; otherwise for m >= 0, a(3m) = 1, a(3m-1) = a(2m-1) + sign(a(2m-1)), a(3m+1) = a(2m+1) + sign(a(2m+1)).
3
1, 0, 0, 1, 2, 2, 1, 3, 3, 1, 4, 4, 1, 2, 2, 1, 5, 5, 1, 3, 3, 1, 2, 2, 1, 6, 6, 1, 4, 4, 1, 2, 2, 1, 3, 3, 1, 7, 7, 1, 2, 2, 1, 5, 5, 1, 3, 3, 1, 2, 2, 1, 4, 4, 1, 8, 8, 1, 2, 2, 1, 3, 3, 1, 6, 6, 1, 2, 2, 1, 4, 4, 1, 3, 3, 1, 2, 2, 1, 5, 5, 1
OFFSET
0,5
COMMENTS
We choose a form for the definition that shows clearly its relationship to A307744.
The odd bisection is essentially A087088.
If we add a(-1) = 0 to the definition and allow negative m (and therefore n), we get a symmetric function, that is a(n) = a(-n).
For k >= 1 numbers 1..k occur with the same periodic and mirror symmetries as in A307744 and in ruler function A051064. In A051064, k occurs 3 times more frequently than k+1. Here, and in A307744, k occurs 3/2 times more frequently than k+1, precisely 2^(k-1) times in every 3^k terms.
PROG
(PARI) a(n) = if (n==1, 0, if ((n%3) == 0, 1, if ((n%3)==1, my(k=(n-1)/3, aa = a(2*k+1)); aa+sign(aa), my(k=(n+1)/3, aa = a(2*k-1)); aa+sign(aa)))); \\ Michel Marcus, Jul 03 2020
CROSSREFS
Sequences with similar definitions: A205593, A307744.
A051064 has matching symmetries.
Odd bisection: A087088.
Sequence in context: A292594 A093613 A344086 * A344087 A118816 A283904
KEYWORD
nonn,easy
AUTHOR
Peter Munn, Jun 30 2020
STATUS
approved