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.

A371263 The run lengths transform of the balanced ternary expansion of n corresponds to the run lengths transform of the binary expansion of a(n).

This page as a plain text file.
%I A371263 #11 Mar 17 2024 12:51:14
%S A371263 0,1,2,2,3,4,5,5,5,4,5,6,6,7,8,9,9,10,11,10,10,10,11,11,10,10,9,8,9,
%T A371263 10,10,11,12,13,13,13,12,13,14,14,15,16,17,17,18,19,18,18,18,19,20,21,
%U A371263 21,22,23,22,21,21,20,20,21,21,21,20,21,22,22,23,23,22
%N A371263 The run lengths transform of the balanced ternary expansion of n corresponds to the run lengths transform of the binary expansion of a(n).
%C A371263 For any v > 0, the value v appears A225081(v-1) times in the sequence.
%H A371263 Rémy Sigrist, <a href="/A371263/b371263.txt">Table of n, a(n) for n = 0..9841</a>
%F A371263 abs(a(n+1) - a(n)) <= 1.
%e A371263 The first terms, alongside the balanced ternary expansion of n and the binary expansion of a(n), are:
%e A371263   n   a(n)  bter(n)  bin(a(n))
%e A371263   --  ----  -------  ---------
%e A371263    0     0        0          0
%e A371263    1     1        1          1
%e A371263    2     2       1T         10
%e A371263    3     2       10         10
%e A371263    4     3       11         11
%e A371263    5     4      1TT        100
%e A371263    6     5      1T0        101
%e A371263    7     5      1T1        101
%e A371263    8     5      10T        101
%e A371263    9     4      100        100
%e A371263   10     5      101        101
%e A371263   11     6      11T        110
%e A371263   12     6      110        110
%e A371263   13     7      111        111
%e A371263   14     8     1TTT       1000
%e A371263   15     9     1TT0       1001
%o A371263 (PARI) a(n) = { my (r = [], d, l, v = 0); while (n, d = centerlift(Mod(n, 3)); l = 0; while (centerlift(Mod(n, 3))==d, n = (n-d)/3; l++;); r = concat(l, r);); for (k = 1, #r, v = (v+k%2)*2^r[k]-k%2); v }
%Y A371263 See A371256 for a similar sequence.
%Y A371263 Cf. A225081, A371265.
%K A371263 nonn,base
%O A371263 0,3
%A A371263 _Rémy Sigrist_, Mar 16 2024