OFFSET
0,3
LINKS
EXAMPLE
A333776(90) = 106, hence a(106) = 96.
PROG
(PARI) a(n, base=2) = { my (d=Vecrev(digits(n, base)), v=0); forstep (k=#d, 1, -1, v += d[k]*base^(k-1); if (d[k], d=Vecrev(d[1..k-1]))); v }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 05 2020
STATUS
approved