OFFSET
0,4
COMMENTS
A ternary-to-binary map.
Each k appears A001316(k) times in the sequence.
EXAMPLE
a(76) = 10 since 76 = 2211_3 and looking for changing digits produces 1010 which, read as if in binary, is 10.
PROG
(PARI) a(n) = my(v=digits(n, 3)); if(#v, forstep(k=#v, 2, -1, v[k]=(v[k]!=v[k-1])); v[1]=1); fromdigits(v, 2); \\ Kevin Ryde, Apr 15 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Henry Bottomley, Apr 04 2001
EXTENSIONS
Definition rewritten by Editors of OEIS, Apr 15 2021.
STATUS
approved