cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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

Views

Author

Peter Munn, Jun 30 2020

Keywords

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.

Crossrefs

Sequences with similar definitions: A205593, A307744.
A051064 has matching symmetries.
Odd bisection: A087088.

Programs

  • 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